Fix: Auto-detect current directory if occ exists locally
- Prüft zuerst, ob ./occ und ./config/config.php existieren - Falls ja, verwendet aktuelles Verzeichnis als Nextcloud-Pfad - Deutlich verbesserte Pfaderkennung - Automatische Upgrade-Prüfung mit Abfrage - Verbesserte Talk-App-Erkennung (spreed/talk) Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
@ -5,14 +5,16 @@
|
||||
# FÜHRUNGSHINWEISE:
|
||||
# 1. Führe dieses Script AUF DEM NEXTcloud-SERVER aus
|
||||
# 2. Als Benutzer mit sudo-Rechten ausführen
|
||||
# 3. Das Script sucht automatisch nach dem Nextcloud-Verzeichnis
|
||||
# 3. Ideal: Aus dem Nextcloud-Verzeichnis heraus starten
|
||||
# Dann wird automatisch das aktuelle Verzeichnis erkannt
|
||||
#
|
||||
# Beispiel:
|
||||
# cd /pfad/zu/nextcloud
|
||||
# sudo ./nextcloud_talk_manager.sh
|
||||
# ODER
|
||||
# ./nextcloud_talk_manager.sh
|
||||
#
|
||||
# Falls Nextcloud nicht automatisch gefunden wird, gib den Pfad manuell ein
|
||||
# Oder von jedem Verzeichnis aus:
|
||||
# sudo ./pfad/zum/nextcloud_talk_manager.sh
|
||||
# (Das Script fragt dann nach dem Nextcloud-Pfad)
|
||||
|
||||
# Farben für bessere Lesbarkeit
|
||||
RED='\033[0;31m'
|
||||
@ -21,8 +23,13 @@ YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# Funktion zum Finden des Nextcloud-Verzeichnisses
|
||||
find_nextcloud_dir() {
|
||||
# Prüfe ob wir uns bereits im Nextcloud-Verzeichnis befinden
|
||||
if [ -f "./occ" ] && [ -f "./config/config.php" ]; then
|
||||
NEXTCLOUD_DIR="."
|
||||
echo -e "${GREEN}Nextcloud-Verzeichnis: aktuelles Verzeichnis (.)${NC}"
|
||||
else
|
||||
# Funktion zum Finden des Nextcloud-Verzeichnisses
|
||||
find_nextcloud_dir() {
|
||||
# Häufige Pfade
|
||||
local possible_paths=(
|
||||
"/var/www/nextcloud"
|
||||
@ -59,16 +66,13 @@ find_nextcloud_dir() {
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
}
|
||||
|
||||
# Nextcloud-Verzeichnis finden
|
||||
NEXTCLOUD_DIR=""
|
||||
|
||||
# Erstversuch: automatische Suche
|
||||
if find_nextcloud_dir > /dev/null 2>&1; then
|
||||
# Nextcloud-Verzeichnis finden
|
||||
if find_nextcloud_dir > /dev/null 2>&1; then
|
||||
NEXTCLOUD_DIR=$(find_nextcloud_dir)
|
||||
echo -e "${GREEN}Nextcloud-Verzeichnis gefunden: $NEXTCLOUD_DIR${NC}"
|
||||
else
|
||||
else
|
||||
# Manuelle Eingabe
|
||||
echo -e "${YELLOW}Nextcloud-Verzeichnis nicht automatisch gefunden.${NC}"
|
||||
echo "Bitte geben Sie den vollständigen Pfad zu Ihrem Nextcloud-Verzeichnis ein"
|
||||
@ -81,6 +85,7 @@ else
|
||||
echo "Bitte überprüfen Sie den Pfad."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Pfad zu PHP finden
|
||||
@ -151,9 +156,10 @@ else
|
||||
fi
|
||||
|
||||
# Prüfe ob Talk-App installiert ist (sucht nach spreed ODER talk)
|
||||
if ! $NC_OCC app:list 2>/dev/null | grep -qiE "\b(spreed|talk)\b"; then
|
||||
echo -e "\n${RED}Warnung: Talk-App (spreed) ist nicht installiert oder aktiviert!${NC}"
|
||||
read -p "Talk-App installieren und aktivieren? (j/n) [n]: " install_talk
|
||||
TALK_APPFOUND=$($NC_OCC app:list 2>/dev/null | grep -iE "spreed|talk")
|
||||
if [ -z "$TALK_APPFOUND" ]; then
|
||||
echo -e "\n${RED}Warnung: Talk-App (spreed) ist nicht installiert!${NC}"
|
||||
read -p "Talk-App installieren? (j/n) [n]: " install_talk
|
||||
if [[ "$install_talk" =~ ^[Jj]$ ]]; then
|
||||
echo -e "${BLUE}Installiere Talk-App...${NC}"
|
||||
$NC_OCC app:install spreed
|
||||
@ -173,6 +179,27 @@ if [ -z "$TALK_ENABLED" ]; then
|
||||
echo -e "${GREEN}Talk-App aktiviert!${NC}"
|
||||
fi
|
||||
|
||||
# Prüfe auf Upgrade-Anforderungen
|
||||
UPGRADE_NEEDED=$($NC_OCC status 2>/dev/null | grep -i "require upgrade")
|
||||
if [ -n "$UPGRADE_NEEDED" ]; then
|
||||
echo -e "\n${RED}Wichtig: Nextcloud oder Apps benötigen ein Upgrade!${NC}"
|
||||
echo "Die meisten OCC-Kommandos sind deaktiviert."
|
||||
read -p "Upgrade jetzt durchführen? (j/n) [j]: " do_upgrade
|
||||
do_upgrade=${do_upgrade:-j}
|
||||
|
||||
if [[ "$do_upgrade" =~ ^[Jj]$ ]]; then
|
||||
echo -e "${BLUE}Führe Upgrade durch...${NC}"
|
||||
$NC_OCC upgrade
|
||||
echo -e "${GREEN}Upgrade abgeschlossen!${NC}"
|
||||
else
|
||||
echo -e "${RED}Warnung: Ohne Upgrade funktionieren viele Kommandos nicht!${NC}"
|
||||
read -p "Trotzdem fortfahren? (j/n) [n]: " continue_anyway
|
||||
if [[ ! "$continue_anyway" =~ ^[Jj]$ ]]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Funktion zum Anzeigen des Menüs
|
||||
show_menu() {
|
||||
clear
|
||||
@ -200,6 +227,7 @@ show_menu() {
|
||||
# Debug-Informationen anzeigen
|
||||
show_debug() {
|
||||
echo -e "\n${BLUE}=== Debug-Informationen ===${NC}\n"
|
||||
echo "Aktuelles Verzeichnis: $(pwd)"
|
||||
echo "Nextcloud-Verzeichnis: $NEXTCLOUD_DIR"
|
||||
echo "PHP-Pfad: $PHP_PATH"
|
||||
echo "Webserver-Benutzer: $WEB_USER"
|
||||
|
||||
Reference in New Issue
Block a user