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

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. #!/bin/bash
  2. [ `id -u` -ne 0 ] && echo 'root privilege required' && exit 1
  3. if [ ! -d /opt/debian-bash ]; then
  4. TEMP=`mktemp -d`
  5. cd $TEMP
  6. echo $TEMP
  7. wget https://git.artcode.re/pvincent/debian-bash/archive/master.tar.gz
  8. tar -xzf master.tar.gz
  9. mv debian-bash /opt/
  10. cd /opt/debian-bash
  11. ./install.sh
  12. rm -rf $TEMP
  13. exit 0
  14. fi
  15. BASEDIR=$PWD
  16. [ ! $BASEDIR == '/opt/debian-bash' ] && echo 'should be installed from /opt/debian-bash directory' && exit 1
  17. ORIGINAL="ORIGINAL"
  18. declare -a arr=(/etc/bash.bashrc /etc/inputrc /etc/vim/vimrc)
  19. for i in "${arr[@]}"
  20. do
  21. if [ ! -f "$i.$ORIGINAL" ]; then
  22. echo "$i needs installation $(basename $i)"
  23. mv "$i" "$i.$ORIGINAL"
  24. ln -s "$BASEDIR/$(basename $i)" "$i"
  25. else
  26. echo "$i" already overriden
  27. fi
  28. done
  29. source /etc/bash.bashrc