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