Update UPDATE.sh

This commit is contained in:
Stefan Pejcic 2024-08-15 15:03:06 +02:00 committed by GitHub
parent 0b98646578
commit df9af405fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -98,6 +98,9 @@ FUNCTIONS=(
# update opencli
opencli_update
# repalce ip with username in nginx container files
nginx_change_in
#
verify_license
@ -251,6 +254,35 @@ opencli_update(){
nginx_change_in(){
# Check if jq is installed
if ! command -v jq &> /dev/null; then
# Install jq using apt
sudo apt-get update > /dev/null 2>&1
sudo apt-get install -y -qq jq > /dev/null 2>&1
# Check if installation was successful
if ! command -v jq &> /dev/null; then
echo "Error: jq installation failed. Please install jq manually and try again."
exit 1
fi
fi
DOCKER_USERS=$(opencli user-list --json | jq -r '.[].username')
# Loop kroz Docker usere i pokreni skript
for USERNAME in $DOCKER_USERS; do
# Run the user-specific script
opencli nginx-update_vhosts $USERNAME
done
opencli server-recreate_hosts
docker exec nginx bash -c "nginx -t && nginx -s reload"
}
run_custom_postupdate_script() {
echo "Checking if post-update script is provided.."