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.

21 lines
471 B

5 years ago
  1. #!/bin/bash
  2. [ `id -u` -ne 0 ] && echo 'root privilege required' && exit 1
  3. BASEDIR=$PWD
  4. [ ! $BASEDIR == '/opt/debian-bash' ] && echo 'should be installed in /opt/debian-bash directory' && exit 1
  5. ORIGINAL="ORIGINAL"
  6. declare -a arr=(/etc/bash.bashrc /etc/inputrc /etc/vim/vimrc)
  7. for i in "${arr[@]}"
  8. do
  9. if [ -f "$i.$ORIGINAL" ]; then
  10. echo "uninstalling $i"
  11. rm "$i"
  12. mv "$i.$ORIGINAL" "$i"
  13. else
  14. echo "$i" not overriden
  15. fi
  16. done