Browse Source

install host|containers

master 0.7.0
pvincent 4 years ago
parent
commit
857475b3fe
  1. 56
      install.sh

56
install.sh

@ -1,9 +1,19 @@
#!/bin/bash
[ `id -u` -ne 0 ] && echo 'root privilege required' && exit 1
BASEDIR=$PWD
function usage {
echo 'usage: --host | --containers | --full'
exit -1
}
function install_host {
echo "install host"
echo --------------
[ `id -u` -ne 0 ] && echo 'root privilege required' && exit 1
if [[ ! $BASEDIR == '/opt/debian-bash' ]]; then
# download and filfull /opt/debian-bash, then run it from folder
@ -15,7 +25,7 @@ if [[ ! $BASEDIR == '/opt/debian-bash' ]]; then
tar -xzf master.tar.gz
mv debian-bash /opt/
cd /opt/debian-bash
./install.sh
./install.sh --
rm -rf $TEMP
exit 0
@ -39,6 +49,20 @@ else
fi
done
source /etc/bash.bashrc
fi
}
function install_containers {
echo "install containers"
echo --------------------
# install inside active LXC containers
if [[ -f '/snap/bin/lxc' ]]; then
for container in `/snap/bin/lxc list -c n --format csv`; do
@ -48,5 +72,29 @@ else
done
fi
source /etc/bash.bashrc
fi
}
function install_one_container {
echo "install container <ONE>"
echo -------------------------
}
PARAM1=$1
case $PARAM1 in
"--host")
install_host
;;
"--containers")
install_containers
;;
"--full")
install_host
install_containers
;;
*)
usage
;;
esac
Loading…
Cancel
Save