From cf7eedc9fcd8cb92bb0f5751686a43e960564aa2 Mon Sep 17 00:00:00 2001 From: pvincent Date: Sun, 7 Jul 2019 12:11:16 +0400 Subject: [PATCH] no more sudo --- install.sh | 9 +++++---- uninstall.sh | 2 -- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index f74f23d..0fe0721 100755 --- a/install.sh +++ b/install.sh @@ -1,5 +1,7 @@ #!/bin/bash +[ `id -u` -ne 0 ] && echo 'root privilege required' && exit 1 + if [ ! -d /opt/debian-bash ]; then TEMP=`mktemp -d` cd $TEMP @@ -8,14 +10,13 @@ if [ ! -d /opt/debian-bash ]; then tar -xzf master.tar.gz mv debian-bash /opt/ cd /opt/debian-bash - sudo ./install.sh + ./install.sh + rm -rf $TEMP exit 0 fi -[ `id -u` -ne 0 ] && echo 'root privilege required' && exit 1 - BASEDIR=$PWD -[ ! $BASEDIR == '/opt/debian-bash' ] && echo 'should be installed in /opt/debian-bash directory' && exit 1 +[ ! $BASEDIR == '/opt/debian-bash' ] && echo 'should be installed from /opt/debian-bash directory' && exit 1 ORIGINAL="ORIGINAL" declare -a arr=(/etc/bash.bashrc /etc/inputrc /etc/vim/vimrc) diff --git a/uninstall.sh b/uninstall.sh index 3d11039..facc1a0 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -1,7 +1,5 @@ #!/bin/bash -# https://github.com/amix/vimrc/raw/master/vimrcs/basic.vim - [ `id -u` -ne 0 ] && echo 'root privilege required' && exit 1 BASEDIR=$PWD