I often mount remote directories, and thought I’d make my workflow more efficient by creating application shortcuts for mounts. Because I wasn’t successful at first, I’ve came up with this bash script which I’m executing using an application shortcut:
#!/bin/bash
echo "commencing mount"
sshfs -v -o ServerAliveInterval=15 server:/ /mnt/target/
echo "mount done!"
read
My shortcut (*.desktop) definition looks like this:
[Desktop Entry]
Comment[en_US]=
Comment=
Exec=/home/user/Scripts/SSHFS-mount-server.sh
GenericName[en_US]=
GenericName=
MimeType=
Name[en_US]=server sshfs
Name=server sshfs
NoDisplay=false
Path=
StartupNotify=true
Terminal=true
TerminalOptions=\s
Type=Application
X-KDE-SubstituteUID=false
X-KDE-Username=
Since adding the read statement I found that the mount is actually working, but strangely it get’s auto-unmounted as soon as the script ends, which is very much different from the behavior I’m used to, namely the mount staying mounted until I unmount it again.
What’s going on here? Can I make the mount stick without blocking the calling script from ending (and keeping the Konsole window started for it open)?