From 3a5c036a88d35762e22c832e7e8a2a6b18f1338b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Je=C4=8Dmenica?= <147708271+radovanjecmenica@users.noreply.github.com> Date: Fri, 25 Apr 2025 15:34:36 +0200 Subject: [PATCH] Update UPDATE.sh --- version/1.2.5/UPDATE.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/version/1.2.5/UPDATE.sh b/version/1.2.5/UPDATE.sh index 8b137891..e662eea4 100644 --- a/version/1.2.5/UPDATE.sh +++ b/version/1.2.5/UPDATE.sh @@ -1 +1,24 @@ +#!/bin/bash + +# Loop through all directories in /home/ +for dir in /home/*; do + username=$(basename "$dir") + CONF_PATH="$dir/crons.ini" + USER_CONF="/etc/openpanel/$username/users.ini" + + # 1. Handle crons.ini directory -> convert to file + if [ -d "$CONF_PATH" ]; then + echo "Found directory: $CONF_PATH - removing and creating a file." + rm -rf "$CONF_PATH" && touch "$CONF_PATH" + fi + + # 2. Check if users.ini exists + if [ ! -f "$USER_CONF" ]; then + echo "users.ini not found for $username, creating it..." + mkdir -p "/etc/openpanel/$username/" + wget -q -O "$USER_CONF" "https://raw.githubusercontent.com/stefanpejcic/openpanel-configuration/refs/heads/main/ofelia/users.ini" + else + echo "users.ini exists for $username, skipping." + fi +done