|
@ -5,14 +5,14 @@ REQUIRED_PKGS=(file git bc) |
|
|
|
|
|
|
|
|
function usage() { |
|
|
function usage() { |
|
|
echo 'usage: --host | --containers | --full | --one-container <CT_NAME>' |
|
|
echo 'usage: --host | --containers | --full | --one-container <CT_NAME>' |
|
|
exit -1 |
|
|
|
|
|
|
|
|
exit 1 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function install_host() { |
|
|
function install_host() { |
|
|
echo "install on: $HOSTNAME" |
|
|
echo "install on: $HOSTNAME" |
|
|
echo ---------------------- |
|
|
echo ---------------------- |
|
|
|
|
|
|
|
|
[ $(id -u) -ne 0 ] && echo 'root privilege required' && exit 1 |
|
|
|
|
|
|
|
|
[ "$(id -u)" -ne 0 ] && echo 'root privilege required' && exit 1 |
|
|
|
|
|
|
|
|
if [[ ! $CURDIR == '/opt/debian-bash' ]]; then |
|
|
if [[ ! $CURDIR == '/opt/debian-bash' ]]; then |
|
|
# download and filfull /opt/debian-bash, then run it from folder |
|
|
# download and filfull /opt/debian-bash, then run it from folder |
|
@ -24,14 +24,14 @@ function install_host() { |
|
|
|
|
|
|
|
|
rm -rf /opt/debian-bash |
|
|
rm -rf /opt/debian-bash |
|
|
TEMP=$(mktemp -d) |
|
|
TEMP=$(mktemp -d) |
|
|
cd $TEMP |
|
|
|
|
|
echo $TEMP |
|
|
|
|
|
|
|
|
cd "$TEMP" || return |
|
|
|
|
|
echo "$TEMP" |
|
|
wget https://git.artcode.re/pvincent/debian-bash/archive/master.tar.gz |
|
|
wget https://git.artcode.re/pvincent/debian-bash/archive/master.tar.gz |
|
|
tar -xzf master.tar.gz |
|
|
tar -xzf master.tar.gz |
|
|
mv debian-bash /opt/ |
|
|
mv debian-bash /opt/ |
|
|
cd /opt/debian-bash |
|
|
|
|
|
./install.sh $PARAM1 |
|
|
|
|
|
rm -rf $TEMP |
|
|
|
|
|
|
|
|
cd /opt/debian-bash || return |
|
|
|
|
|
./install.sh "$PARAM1" |
|
|
|
|
|
rm -rf "$TEMP" |
|
|
exit 0 |
|
|
exit 0 |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
@ -50,7 +50,7 @@ function install_containers() { |
|
|
# install inside active LXC containers |
|
|
# install inside active LXC containers |
|
|
if [[ -f '/snap/bin/lxc' ]]; then |
|
|
if [[ -f '/snap/bin/lxc' ]]; then |
|
|
for container in $(/snap/bin/lxc list --format=json | yq '.[] | select(.state.status == "Running") | .name' -); do |
|
|
for container in $(/snap/bin/lxc list --format=json | yq '.[] | select(.state.status == "Running") | .name' -); do |
|
|
install_one_container $container |
|
|
|
|
|
|
|
|
install_one_container "$container" |
|
|
echo |
|
|
echo |
|
|
done |
|
|
done |
|
|
fi |
|
|
fi |
|
@ -80,8 +80,8 @@ case $PARAM1 in |
|
|
;; |
|
|
;; |
|
|
"--one-container") |
|
|
"--one-container") |
|
|
CT=$2 |
|
|
CT=$2 |
|
|
if [ ! -z $CT ]; then |
|
|
|
|
|
install_one_container $CT |
|
|
|
|
|
|
|
|
if [ ! -z "$CT" ]; then |
|
|
|
|
|
install_one_container "$CT" |
|
|
else |
|
|
else |
|
|
usage |
|
|
usage |
|
|
fi |
|
|
fi |
|
|