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
512 B

11 months ago
11 months ago
11 months ago
11 months ago
  1. #!/bin/bash
  2. set -Eeuo pipefail
  3. [ "$(id -u)" -ne 0 ] && echo 'root privilege required' && exit 1
  4. readonly DEBIAN_BASH_DIR='/opt/debian-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.$ORIGINAL" ]; then
  13. mv "$i" "$i.$ORIGINAL"
  14. basefile=$(basename "$i")
  15. ln -s "$DEBIAN_BASH_DIR/$basefile" "$i"
  16. fi
  17. done