|
@ -2,22 +2,24 @@ |
|
|
|
|
|
|
|
|
set -Eeuo pipefail |
|
|
set -Eeuo pipefail |
|
|
|
|
|
|
|
|
CURDIR=$PWD |
|
|
|
|
|
|
|
|
[ "$(id -u)" -ne 0 ] && echo 'root privilege required' && exit 1 |
|
|
|
|
|
|
|
|
|
|
|
readonly DEBIAN_BASH_DIR='/opt/debian-bash' |
|
|
|
|
|
|
|
|
#remove /etc/skel/.bashrc |
|
|
#remove /etc/skel/.bashrc |
|
|
if [ -e /etc/skel/.bashrc ]; then |
|
|
if [ -e /etc/skel/.bashrc ]; then |
|
|
rm /etc/skel/.bashrc |
|
|
rm /etc/skel/.bashrc |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
ORIGINAL="ORIGINAL" |
|
|
|
|
|
|
|
|
readonly ORIGINAL="ORIGINAL" |
|
|
declare -a arr=(/etc/bash.bashrc /etc/inputrc /etc/vim/vimrc) |
|
|
declare -a arr=(/etc/bash.bashrc /etc/inputrc /etc/vim/vimrc) |
|
|
|
|
|
|
|
|
for i in "${arr[@]}"; do |
|
|
for i in "${arr[@]}"; do |
|
|
if [ ! -f "$i.$ORIGINAL" ]; then |
|
|
if [ ! -f "$i.$ORIGINAL" ]; then |
|
|
|
|
|
|
|
|
echo "$i needs installation $(basename \\"$i\\")" |
|
|
|
|
|
mv "$i" "$i.$ORIGINAL" |
|
|
mv "$i" "$i.$ORIGINAL" |
|
|
ln -s "$CURDIR/$(basename \\"$i\\")" "$i" |
|
|
|
|
|
|
|
|
basefile=$(basename "$i") |
|
|
|
|
|
ln -s "$DEBIAN_BASH_DIR/$basefile" "$i" |
|
|
|
|
|
echo "<$i> installed successfully!" |
|
|
else |
|
|
else |
|
|
echo "<$i> already overriden!" |
|
|
echo "<$i> already overriden!" |
|
|
fi |
|
|
fi |
|
|