LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   NetworkManagerDispatcher and sshfs (https://www.linuxquestions.org/questions/linux-newbie-8/networkmanagerdispatcher-and-sshfs-833674/)

mulebreath 09-21-2010 10:04 PM

NetworkManagerDispatcher and sshfs
 
Can't get the two to work together, I am trying to mount a directory on my home server from a remote location automatically when the wireless connection comes up.

First thing I do is ssh-add and enter my passphrase as root.
Then I run this script in /etc/NetworkManager/dispatcher.d/

------------------------
#!/bin/bash

SSID=`iwgetid --raw`

if [ $2 == "up" ] && [ $SSID == "work" ]; then

sshfs -o sftp_server=/opt/libexec/sftp-server,allow_other example.com:/mnt/bob /home/bob/remote/

fi
------------------------
owner root:root 755

The only error message I ever get is: "Script '/etc/NetworkManager/dispatcher.d/mounting.sh' exited with error status 1", which isn't a lot of help.

The sshfs line is the problem, if I replace it with a simple touch command or whatever, that command will run fine.

When I run this command from cl as root, it works fine. When I run the command as a regular user (add sudo -E to the front of it), it works fine as well. But when I run it in the script, it will not work.

Does anyone have any idea what I'm missing, why NetworkManagerDispatcher refuses to run this perfectly fine command.

tia

mulebreath 09-22-2010 02:47 AM

Actually, after much time and effort, I'm going to scrap the whole sshfs thing as a solution anyway. It regularly and often just goes into a complete hang. And nautilus (in common with any windows os) handles an unresponsive network share like a flaming turd, turn off the computer and soak it in cold water to get it up again.
Couldn't get remote samba working, couldn't get sshfs working, I've got openvpn left to try. The little penguin is kicking my ass yet again.


All times are GMT -5. The time now is 08:56 AM.