From c33a50c7e58f5299ce731ebb3d2a705b8ff8b3f2 Mon Sep 17 00:00:00 2001 From: alf Date: Sun, 9 Nov 2025 10:11:04 +0000 Subject: [PATCH] =?UTF-8?q?sshfser.sh=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sshfser.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 sshfser.sh diff --git a/sshfser.sh b/sshfser.sh new file mode 100644 index 0000000..3c9621e --- /dev/null +++ b/sshfser.sh @@ -0,0 +1,35 @@ +GIT="/home/service/Gitea" +USER="alf" +IPWURZEL="100.87.87" +MOUNTPUNKT="/home/service/FILME" +SERVERWAHL="80 81" +source $GIT/logger/logger.sh +log_init "$GIT/logger/Logs/sshfs.log" +log_start + +log_info "Prüfen, ob schon etwas auf $MOUNTPUNKT gemountet ist" +mount | grep "$MOUNTPUNKT" +MOUNTET=$? +log_info "ERR: $MOUNTET" + +case $MOUNTET in + 1) + log_info "Verzeichnis ist frei." + log_info "Bitte Server wählen..." + SERVER=$(gum choose $SERVERWAHL) + log_info "Gewählter Server: $SERVER" + sshfs -o IdentityFile="$HOME/id_$SERVER" -p2222 $USER@$IPWURZEL.$SERVER:/srv/ $MOUNTPUNKT + log_info "ERR: $?" + ;; + 0) + log_info "Verzeichnis ist belegt! Unmount..." + umount $MOUNTPUNKT + log_info "ERR: $?" + ;; + + *) + log_error "Ungewöhnlicher Rückgabewert: $MOUNTET" + ;; +esac + +log_end \ No newline at end of file