Browse Source

fix minor changes

master
pvincent 11 months ago
parent
commit
0da11812af
  1. 20
      install.sh

20
install.sh

@ -5,14 +5,14 @@ REQUIRED_PKGS=(file git bc)
function usage() {
echo 'usage: --host | --containers | --full | --one-container <CT_NAME>'
exit -1
exit 1
}
function install_host() {
echo "install on: $HOSTNAME"
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
# download and filfull /opt/debian-bash, then run it from folder
@ -24,14 +24,14 @@ function install_host() {
rm -rf /opt/debian-bash
TEMP=$(mktemp -d)
cd $TEMP
echo $TEMP
cd "$TEMP" || return
echo "$TEMP"
wget https://git.artcode.re/pvincent/debian-bash/archive/master.tar.gz
tar -xzf master.tar.gz
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
fi
@ -50,7 +50,7 @@ function install_containers() {
# install inside active LXC containers
if [[ -f '/snap/bin/lxc' ]]; then
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
done
fi
@ -80,8 +80,8 @@ case $PARAM1 in
;;
"--one-container")
CT=$2
if [ ! -z $CT ]; then
install_one_container $CT
if [ ! -z "$CT" ]; then
install_one_container "$CT"
else
usage
fi

Loading…
Cancel
Save