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.

23 lines
528 B

9 months ago
7 months ago
9 months ago
  1. #!/bin/bash
  2. set -Eeuo pipefail
  3. [ "$(id -u)" -ne 0 ] && echo 'root privilege required' && exit 1
  4. readonly MIAOU_BASH_DIR='/opt/miaou-bash'
  5. #remove /etc/skel/.bashrc
  6. if [ -e /etc/skel/.bashrc ]; then
  7. rm /etc/skel/.bashrc
  8. fi
  9. readonly ORIGINAL="ORIGINAL"
  10. declare -a arr=(/etc/bash.bashrc /etc/inputrc /etc/vim/vimrc)
  11. for i in "${arr[@]}"; do
  12. if [[ -f "$i" ]] && [[ ! -f "$i.$ORIGINAL" ]]; then
  13. mv "$i" "$i.$ORIGINAL"
  14. basefile=$(basename "$i")
  15. ln -s "$MIAOU_BASH_DIR/$basefile" "$i"
  16. fi
  17. done