MIAOU-BASH is a collection of settings and helpers for leveraging BASH. Developer-friendly, it may be used as solo package with or without the miaou project.
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.

19 lines
474 B

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