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.

35 lines
824 B

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