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.

24 lines
480 B

1 year ago
1 year ago
1 year ago
1 year ago
  1. #!/bin/bash
  2. set -Eeuo pipefail
  3. CURDIR=$PWD
  4. #remove /etc/skel/.bashrc
  5. if [ -e /etc/skel/.bashrc ]; then
  6. rm /etc/skel/.bashrc
  7. fi
  8. ORIGINAL="ORIGINAL"
  9. declare -a arr=(/etc/bash.bashrc /etc/inputrc /etc/vim/vimrc)
  10. for i in "${arr[@]}"; do
  11. if [ ! -f "$i.$ORIGINAL" ]; then
  12. echo "$i needs installation $(basename \\"$i\\")"
  13. mv "$i" "$i.$ORIGINAL"
  14. ln -s "$CURDIR/$(basename \\"$i\\")" "$i"
  15. else
  16. echo "<$i> already overriden!"
  17. fi
  18. done