#!/bin/bash if [ ! -d /opt/debian-bash ]; then wget -c https://git.artcode.re/pvincent/debian-extra/archive/master.tar.gz -O - | tar -xz /opt/debian-bash cd /opt/debian-bash ./install.sh exit 0 fi # https://github.com/amix/vimrc/raw/master/vimrcs/basic.vim [ `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 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