Aktualisiere Installations- und Konfigurationsskripte zur Verwendung eines neuen Pfads für die Konfigurationsdatei
- Ä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.
This commit is contained in:
@@ -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 ==="
|
||||
|
||||
Reference in New Issue
Block a user