Füge Korrektur für den Pfad der Konfigurationsdatei hinzu
- Implementiere eine Überprüfung in den Skripten `install.sh` und `update_config.sh`, um sicherzustellen, dass die Konfigurationsdatei an dem richtigen Ort liegt. Falls nicht, wird die Datei verschoben und die Berechtigungen sowie der Eigentümer entsprechend angepasst.
This commit is contained in:
@@ -35,6 +35,14 @@ 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
|
||||
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
|
||||
fi
|
||||
|
||||
# Systemd Service erstellen
|
||||
echo "=== Systemd Service erstellen ==="
|
||||
sudo tee /etc/systemd/system/yourchat.service > /dev/null <<EOF
|
||||
|
||||
@@ -10,6 +10,14 @@ echo "=== YourChat - Konfigurations-Update Script ==="
|
||||
CONFIG_SOURCE="config/chatconfig.json"
|
||||
CONFIG_TARGET="/opt/yourchat/config/chatconfig.json"
|
||||
|
||||
# Korrigiere falls die Datei am falschen Ort liegt
|
||||
if [ -f "/opt/yourchat/chatconfig.json" ] && [ ! -f "$CONFIG_TARGET" ]; then
|
||||
echo "Korrigiere Konfigurationsdatei-Pfad..."
|
||||
sudo mv /opt/yourchat/chatconfig.json "$CONFIG_TARGET"
|
||||
sudo chown yourchat:yourchat "$CONFIG_TARGET"
|
||||
sudo chmod 644 "$CONFIG_TARGET"
|
||||
fi
|
||||
|
||||
# Prüfe ob Quell-Konfiguration existiert
|
||||
if [ ! -f "$CONFIG_SOURCE" ]; then
|
||||
echo "Fehler: Quell-Konfiguration $CONFIG_SOURCE nicht gefunden."
|
||||
|
||||
Reference in New Issue
Block a user