|
|
@ -2,7 +2,12 @@ |
|
|
|
|
|
|
|
[ `id -u` -ne 0 ] && echo 'root privilege required' && exit 1 |
|
|
|
|
|
|
|
if [ ! -d /opt/debian-bash ]; then |
|
|
|
BASEDIR=$PWD |
|
|
|
|
|
|
|
if [ $BASEDIR -ne '/opt/debian-bash' ]; then |
|
|
|
# download and filfull /etc/debian-bash, then run it from folder |
|
|
|
|
|
|
|
rm -rf /opt/debian-bash |
|
|
|
TEMP=`mktemp -d` |
|
|
|
cd $TEMP |
|
|
|
echo $TEMP |
|
|
@ -13,10 +18,8 @@ if [ ! -d /opt/debian-bash ]; then |
|
|
|
./install.sh |
|
|
|
rm -rf $TEMP |
|
|
|
exit 0 |
|
|
|
fi |
|
|
|
|
|
|
|
BASEDIR=$PWD |
|
|
|
[ ! $BASEDIR == '/opt/debian-bash' ] && echo 'should be installed from /opt/debian-bash directory' && exit 1 |
|
|
|
else |
|
|
|
|
|
|
|
ORIGINAL="ORIGINAL" |
|
|
|
declare -a arr=(/etc/bash.bashrc /etc/inputrc /etc/vim/vimrc) |
|
|
@ -33,4 +36,14 @@ do |
|
|
|
fi |
|
|
|
done |
|
|
|
|
|
|
|
# install inside active LXC containers |
|
|
|
if [[ -f '/snap/bin/lxc' ]]; then |
|
|
|
for container in `lxc list -c n --format csv`; do |
|
|
|
echo "pushed to $container" |
|
|
|
/snap/bin/lxc file push /opt/debian-bash "${container}/opt/" -r |
|
|
|
/snap/bin/lxc exec "$container" -- sh -c "cd /opt/debian-bash && ./install.sh" |
|
|
|
done |
|
|
|
fi |
|
|
|
|
|
|
|
source /etc/bash.bashrc |
|
|
|
fi |