sshfser.sh hinzugefügt
This commit is contained in:
35
sshfser.sh
Normal file
35
sshfser.sh
Normal file
@ -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
|
||||
Reference in New Issue
Block a user