From f5a5f5ae2c96e3ab6d7a70944ca6920a1ecd5823 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Mon, 1 Sep 2025 16:39:52 +0200 Subject: [PATCH] =?UTF-8?q?Aktualisiere=20Installations-=20und=20Konfigura?= =?UTF-8?q?tionsskripte=20zur=20Verwendung=20eines=20neuen=20Pfads=20f?= =?UTF-8?q?=C3=BCr=20die=20Konfigurationsdatei?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Ändere den Zielpfad der Konfigurationsdatei in `install.sh` und `update_config.sh` von `/opt/yourchat/config/chatconfig.json` nach `/etc/yourpart/chatconfig.json`. - Füge die Erstellung des Verzeichnisses `/etc/yourpart` im Installationsskript hinzu und passe die Berechtigungen entsprechend an. --- deploy/install.sh | 20 ++++++++++++-------- deploy/update_config.sh | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/deploy/install.sh b/deploy/install.sh index 8f77aaf..0d26ad5 100755 --- a/deploy/install.sh +++ b/deploy/install.sh @@ -16,9 +16,12 @@ fi # Installationsverzeichnis erstellen echo "=== Installationsverzeichnis erstellen ===" sudo mkdir -p /opt/yourchat -sudo mkdir -p /opt/yourchat/config sudo mkdir -p /opt/yourchat/logs +# Systemweite Konfiguration erstellen +echo "=== Systemweite Konfiguration erstellen ===" +sudo mkdir -p /etc/yourpart + # Anwendung installieren echo "=== Anwendung installieren ===" sudo cp build/yourchat /opt/yourchat/ @@ -28,19 +31,19 @@ sudo chmod +x /opt/yourchat/ws_probe # Konfiguration installieren (nur wenn nicht vorhanden) echo "=== Konfiguration installieren ===" -if [ ! -f "/opt/yourchat/config/chatconfig.json" ]; then - sudo cp config/chatconfig.json /opt/yourchat/config/ +if [ ! -f "/etc/yourpart/chatconfig.json" ]; then + sudo cp config/chatconfig.json /etc/yourpart/ echo "Konfigurationsdatei installiert." else echo "Konfigurationsdatei existiert bereits - wird nicht überschrieben." fi # Korrigiere falls die Datei am falschen Ort liegt -if [ -f "/opt/yourchat/chatconfig.json" ] && [ ! -f "/opt/yourchat/config/chatconfig.json" ]; then +if [ -f "/opt/yourchat/chatconfig.json" ] && [ ! -f "/etc/yourpart/chatconfig.json" ]; then echo "Korrigiere Konfigurationsdatei-Pfad..." - sudo mv /opt/yourchat/chatconfig.json /opt/yourchat/config/ - sudo chown yourchat:yourchat /opt/yourchat/config/chatconfig.json - sudo chmod 644 /opt/yourchat/config/chatconfig.json + sudo mv /opt/yourchat/chatconfig.json /etc/yourpart/ + sudo chown yourchat:yourchat /etc/yourpart/chatconfig.json + sudo chmod 644 /etc/yourpart/chatconfig.json fi # Systemd Service erstellen @@ -78,7 +81,8 @@ fi echo "=== Berechtigungen setzen ===" sudo chown -R yourchat:yourchat /opt/yourchat sudo chmod 755 /opt/yourchat -sudo chmod 644 /opt/yourchat/config/chatconfig.json +sudo chown yourchat:yourchat /etc/yourpart/chatconfig.json +sudo chmod 644 /etc/yourpart/chatconfig.json # Systemd Service aktivieren echo "=== Systemd Service aktivieren ===" diff --git a/deploy/update_config.sh b/deploy/update_config.sh index 31be7e9..6d335b6 100755 --- a/deploy/update_config.sh +++ b/deploy/update_config.sh @@ -8,7 +8,7 @@ set -e # Beende bei Fehlern echo "=== YourChat - Konfigurations-Update Script ===" CONFIG_SOURCE="config/chatconfig.json" -CONFIG_TARGET="/opt/yourchat/config/chatconfig.json" +CONFIG_TARGET="/etc/yourpart/chatconfig.json" # Korrigiere falls die Datei am falschen Ort liegt if [ -f "/opt/yourchat/chatconfig.json" ] && [ ! -f "$CONFIG_TARGET" ]; then