You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

36 lines
838 B

#!/bin/bash
[ `id -u` -ne 0 ] && echo 'root privilege required' && exit 1
if [ ! -d /opt/debian-bash ]; then
TEMP=`mktemp -d`
cd $TEMP
echo $TEMP
wget https://git.artcode.re/pvincent/debian-bash/archive/master.tar.gz
tar -xzf master.tar.gz
mv debian-bash /opt/
cd /opt/debian-bash
./install.sh
rm -rf $TEMP
exit 0
fi
BASEDIR=$PWD
[ ! $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)
for i in "${arr[@]}"
do
if [ ! -f "$i.$ORIGINAL" ]; then
echo "$i needs installation $(basename $i)"
mv "$i" "$i.$ORIGINAL"
ln -s "$BASEDIR/$(basename $i)" "$i"
else
echo "$i" already overriden
fi
done
source /etc/bash.bashrc