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
|
# Installationsverzeichnis erstellen
|
||||||
echo "=== Installationsverzeichnis erstellen ==="
|
echo "=== Installationsverzeichnis erstellen ==="
|
||||||
sudo mkdir -p /opt/yourchat
|
sudo mkdir -p /opt/yourchat
|
||||||
sudo mkdir -p /opt/yourchat/config
|
|
||||||
sudo mkdir -p /opt/yourchat/logs
|
sudo mkdir -p /opt/yourchat/logs
|
||||||
|
|
||||||
|
# Systemweite Konfiguration erstellen
|
||||||
|
echo "=== Systemweite Konfiguration erstellen ==="
|
||||||
|
sudo mkdir -p /etc/yourpart
|
||||||
|
|
||||||
# Anwendung installieren
|
# Anwendung installieren
|
||||||
echo "=== Anwendung installieren ==="
|
echo "=== Anwendung installieren ==="
|
||||||
sudo cp build/yourchat /opt/yourchat/
|
sudo cp build/yourchat /opt/yourchat/
|
||||||
@@ -28,19 +31,19 @@ sudo chmod +x /opt/yourchat/ws_probe
|
|||||||
|
|
||||||
# Konfiguration installieren (nur wenn nicht vorhanden)
|
# Konfiguration installieren (nur wenn nicht vorhanden)
|
||||||
echo "=== Konfiguration installieren ==="
|
echo "=== Konfiguration installieren ==="
|
||||||
if [ ! -f "/opt/yourchat/config/chatconfig.json" ]; then
|
if [ ! -f "/etc/yourpart/chatconfig.json" ]; then
|
||||||
sudo cp config/chatconfig.json /opt/yourchat/config/
|
sudo cp config/chatconfig.json /etc/yourpart/
|
||||||
echo "Konfigurationsdatei installiert."
|
echo "Konfigurationsdatei installiert."
|
||||||
else
|
else
|
||||||
echo "Konfigurationsdatei existiert bereits - wird nicht überschrieben."
|
echo "Konfigurationsdatei existiert bereits - wird nicht überschrieben."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Korrigiere falls die Datei am falschen Ort liegt
|
# 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..."
|
echo "Korrigiere Konfigurationsdatei-Pfad..."
|
||||||
sudo mv /opt/yourchat/chatconfig.json /opt/yourchat/config/
|
sudo mv /opt/yourchat/chatconfig.json /etc/yourpart/
|
||||||
sudo chown yourchat:yourchat /opt/yourchat/config/chatconfig.json
|
sudo chown yourchat:yourchat /etc/yourpart/chatconfig.json
|
||||||
sudo chmod 644 /opt/yourchat/config/chatconfig.json
|
sudo chmod 644 /etc/yourpart/chatconfig.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Systemd Service erstellen
|
# Systemd Service erstellen
|
||||||
@@ -78,7 +81,8 @@ fi
|
|||||||
echo "=== Berechtigungen setzen ==="
|
echo "=== Berechtigungen setzen ==="
|
||||||
sudo chown -R yourchat:yourchat /opt/yourchat
|
sudo chown -R yourchat:yourchat /opt/yourchat
|
||||||
sudo chmod 755 /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
|
# Systemd Service aktivieren
|
||||||
echo "=== Systemd Service aktivieren ==="
|
echo "=== Systemd Service aktivieren ==="
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ set -e # Beende bei Fehlern
|
|||||||
echo "=== YourChat - Konfigurations-Update Script ==="
|
echo "=== YourChat - Konfigurations-Update Script ==="
|
||||||
|
|
||||||
CONFIG_SOURCE="config/chatconfig.json"
|
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
|
# Korrigiere falls die Datei am falschen Ort liegt
|
||||||
if [ -f "/opt/yourchat/chatconfig.json" ] && [ ! -f "$CONFIG_TARGET" ]; then
|
if [ -f "/opt/yourchat/chatconfig.json" ] && [ ! -f "$CONFIG_TARGET" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user