diff --git a/misc/update-lxcs.sh b/misc/update-lxcs.sh index 63b452c9..80bd78cc 100644 --- a/misc/update-lxcs.sh +++ b/misc/update-lxcs.sh @@ -1,4 +1,15 @@ #!/bin/bash +function header_info { + cat <<"EOF" + __ __ __ __ __ _ ________ + / / / /___ ____/ /___ _/ /____ / / | |/ / ____/ + / / / / __ \/ __ / __ `/ __/ _ \ / / | / / +/ /_/ / /_/ / /_/ / /_/ / /_/ __/ / /___/ / /___ +\____/ .___/\__,_/\__,_/\__/\___/ /_____/_/|_\____/ + /_/ + +EOF +} set -e YW=$(echo "\033[33m") BL=$(echo "\033[36m") @@ -6,6 +17,8 @@ RD=$(echo "\033[01;31m") CM='\xE2\x9C\x94\033' GN=$(echo "\033[1;92m") CL=$(echo "\033[m") +clear +header_info while true; do read -p "This Will Update All LXC Containers. Proceed(y/n)?" yn case $yn in @@ -15,19 +28,6 @@ while true; do esac done clear -function header_info { - cat <<"EOF" - __ __ __ __ __ _ ________ - / / / /___ ____/ /___ _/ /____ / / | |/ / ____/ - / / / / __ \/ __ / __ `/ __/ _ \ / / | / / -/ /_/ / /_/ / /_/ / /_/ / /_/ __/ / /___/ / /___ -\____/ .___/\__,_/\__,_/\__/\___/ /_____/_/|_\____/ - /_/ - -EOF -} -header_info - containers=$(pct list | tail -n +2 | cut -f1 -d' ') function update_container() { @@ -50,7 +50,7 @@ function update_container() { pct exec $container -- bash -c "yum -y update" fi } - +header_info read -p "Skip stopped containers? " -n 1 -r echo if [[ ! $REPLY =~ ^[Yy]$ ]]; then @@ -82,4 +82,6 @@ for container in $containers; do done wait rm -rf temp +clear +header_info echo -e "${GN} Finished, All Containers Updated. ${CL} \n"