From 2fe1196a90837633eb0e1b95e3ba644836fdc976 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 6 Nov 2025 20:38:09 -0800 Subject: [PATCH] Update set-permissions.sh --- etc/set-permissions.sh | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/etc/set-permissions.sh b/etc/set-permissions.sh index 66d42d6..21c53ae 100644 --- a/etc/set-permissions.sh +++ b/etc/set-permissions.sh @@ -30,12 +30,20 @@ fi echo "Setting ownership to $TARGET_USER:$TARGET_USER" -chown -R "$TARGET_USER:$TARGET_USER" "/opt/meshing-around" -chown -R "$TARGET_USER:$TARGET_USER" "/opt/meshing-around/logs" -chown -R "$TARGET_USER:$TARGET_USER" "/opt/meshing-around/data" -chown "$TARGET_USER:$TARGET_USER" "/opt/meshing-around/config.ini" -chmod 664 "/opt/meshing-around/config.ini" -chmod 775 "/opt/meshing-around/logs" -chmod 775 "/opt/meshing-around/data" +for dir in "/opt/meshing-around" "/opt/meshing-around/logs" "/opt/meshing-around/data"; do + if [ -d "$dir" ]; then + chown -R "$TARGET_USER:$TARGET_USER" "$dir" + chmod 775 "$dir" + else + echo "Warning: Directory $dir does not exist, skipping." + fi +done + +if [ -f "/opt/meshing-around/config.ini" ]; then + chown "$TARGET_USER:$TARGET_USER" "/opt/meshing-around/config.ini" + chmod 664 "/opt/meshing-around/config.ini" +else + echo "Warning: /opt/meshing-around/config.ini does not exist, skipping." +fi echo "Permissions and ownership have been set." \ No newline at end of file