[Trilug-ontopic] raspberry pi - mounting a sshfs drive at startup

Greg Brown gwbrown1 at gmail.com
Sun Aug 4 19:38:41 EDT 2013


I figured out a way around my issue of mounting the drive at bootup and
that was to mount the drive when motion starts and unmounting the drive
when it stops.  I wrote a fairly simple script that looks like this and is
called connect.sh in /home/pi:

#!/bin/bash

/bin/echo password | /usr/bin/sudo /usr/bin/sshfs
myuser at 192.168.16.2:/Users/myuser/motion/blue
/mount -o allow_other -o password_stdin

Once that was created I edited /etc/init.d/motion to run the script when
motion starts and unmount when motion ends.  Seems simple enough and it
works.



On Mon, Jul 29, 2013 at 10:41 PM, Alan Porter <porter at trilug.org> wrote:

>
>  and that didn't work yet if I run the command from the command line as
>> root or pi both will work.
>>
>
> This suggests to me that you have something in your login shell
> environment that is needed by the script.  I can't imagine what it would
> be.  It could be something as simple as the search path to find sshfs.  But
> you could try something like "source /etc/profile ; /usr/bin/sshfs blah
> blah".
>
> Better yet, wrap it all in a shell script so you can do whatever kind of
> sorcery needed without making your crontab look like a beast.  I usually
> have a $HOME/cron directory for these sorts of scripts.
>
> Alan
>
>
>
> ______________________________**_________________
> Trilug-ontopic mailing list
> Trilug-ontopic at trilug.org
> http://www.trilug.org/mailman/**listinfo/trilug-ontopic<http://www.trilug.org/mailman/listinfo/trilug-ontopic>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.trilug.org/pipermail/trilug-ontopic/attachments/20130804/5166b47c/attachment.html>


More information about the Trilug-ontopic mailing list