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
509 B
23 lines
509 B
#!/bin/bash
|
|
|
|
set -Eeuo pipefail
|
|
|
|
[ "$(id -u)" -ne 0 ] && echo 'root privilege required' && exit 1
|
|
|
|
readonly MIAOU_BASH_DIR='/opt/miaou-bash'
|
|
|
|
#remove /etc/skel/.bashrc
|
|
if [ -e /etc/skel/.bashrc ]; then
|
|
rm /etc/skel/.bashrc
|
|
fi
|
|
|
|
readonly ORIGINAL="ORIGINAL"
|
|
declare -a arr=(/etc/bash.bashrc /etc/inputrc /etc/vim/vimrc)
|
|
|
|
for i in "${arr[@]}"; do
|
|
if [ ! -f "$i.$ORIGINAL" ]; then
|
|
mv "$i" "$i.$ORIGINAL"
|
|
basefile=$(basename "$i")
|
|
ln -s "$MIAOU_BASH_DIR/$basefile" "$i"
|
|
fi
|
|
done
|