• The forum software that supports hummy.tv has been upgraded to XenForo 2.3!

    Please bear with us as we continue to tweak things, and feel free to post any questions, issues or suggestions in the upgrade thread.

Is it possible to trigger NASMount to mount a NAS when that NAS starts up?

It's your funeral, not ours. Do it whatever way you like. We can only advise (and any advice given is purely voluntary – there is no beef).
What's that about my funeral? Do you know something I don't :eek:

Perhaps it does make some sense, if you mean the NAS script Telnets into the Foxsat to send the command for the Foxsat to run. But it doesn't really account for error responses, and the Telnet login credentials will have to be stored in the NAS script in the clear (if security bothers you). A significant reason for not injecting commands to a remote system are the security implications: file access permissions are lower risk than command access.
I have generated a key pair on the NAS and sent it to the Foxsat
ssh-copy-id -i ~/.ssh/id_rsa.pub Humax@ip.of.the.foxsat
That means I can SSH into the Foxsat with no password. SSH is encrypted so no sending of anything in the clear. It does mean that if the NAS gets hacked, they get access to my Foxsat too. However, they'd need to break in as root to get access to the private keys. The Foxsat is easier to break into.

I agree injecting commands is not a great. I wouldn't do that on a public network.

Fundamentally, the NAS should be an extension to the Foxsat's file system. It is therefore far more logical that the Foxsat is in control of the process. How do you plan to handle unmounting when the NAS drops out? What happens if the Foxsat wasn't responding at the time the NAS booted?
I have written a couple of bash files and placed them inside the foxsat, one to mount, the other to unmount. It appears that unmounting does nothing useful though. If the NAS is unmounted while the foxsat is playing, it seems the foxsat continues to play? I guess that the network is marked as busy so though the command it sent, it actually hasn't dropped the mount. If the network disconnects while NAS is mounted, play freezes, and after a while, a message shows up saying the channel in encrypted. That's fine though.

I didn't do much yesterday besides setting up the SSH and adding two files to the NAS, which SSH into the FOXSAT to call two other files. Idea with that was I can go either (internal or remote) to mount or un-mount. I did try to do it your way to start. I created a third bash file and intended it to be the ping file. Idea is

Ping NAS
if NAS alive
{
if already mounted { exit }
else {mount the nas}
}
else
{
if already mounted { dismount }
else { exit }
}

Unfortunately I got stuck with a stupid bash problem. My "if" kept throwing an error. "No fi" it said. Liar I said. - grrrr.
I can mount (or dismount) the NAS from the NAS now, I haven't set it up to be automatic on startup as yet.

Slow replies, sorry.
 
Does that make me sadistic or masochistic? Maybe a little of both ;)
Yes. I would have you locked up if I were the people you'd inflicted it on. But then you might think that about me :o_O:.
If the NAS is unmounted while the foxsat is playing, it seems the foxsat continues to play?
I guess it's a lazy unmount i.e. it will unmount when the last file using it is closed.
Unfortunately I got stuck with a stupid bash problem.
Bash is not C. As /df always says, shellcheck.net is your friend.
Code:
#!/bin/sh
if true; then
  echo Yes
else
  echo No
fi
 
Yes. I would have you locked up
I'm a good buoy I am, honest guvna 🤥

Bash is not C. As /df always says, had to remove as I'm not allowed to post external links yet, even as a quote is your friend.
#!/bin/sh if true; then echo Yes else echo No fi
I'll look at that site, thanks. I have to stop you at line 1 though as no such directory exists on the Foxsat so I removed it yesterday from the mount and unmount files just to get it to work. There is a sh link to nowhere in /bin. Script seems to default to bash without it, so when I got time, I will use find to look for 'dash'. Think the root of the file system is locked into flash memory so it be somewhere different. There's a lack of bash commands to check what's mounted in the Foxsat so I decided to look for the IP address of the NAS in the mount instead. If it's there, it's mounted, if not, it isn't.

Code:
/bin/mount | grep 192.168.143.12 > /dev/null && r=true || r=false;
echo $r
if ($r); then
echo"hurrah"
else
echo"Boooo!!" ;
fi
exit 0

Below is output from the Foxsat command line.
Code:
Foxsat-HDR~# /mnt/hd4/opt/bash/NASPing.sh
: not foundt/bash/NASPing.sh: /mnt/hd4/opt/bash/NASPing.sh: 1:
false
/mnt/hd4/opt/bash/NASPing.sh: /mnt/hd4/opt/bash/NASPing.sh: 10: Syntax error: end of file unexpected (expecting "fi")
Foxsat-HDR~#
Foxsat-HDR~#

Foxsat-HDR~# /mnt/hd4/opt/bash/NASmount.sh
Foxsat-HDR~#
Foxsat-HDR~# /mnt/hd4/opt/bash/NASPing.sh
: not foundt/bash/NASPing.sh: /mnt/hd4/opt/bash/NASPing.sh: 1:
true
/mnt/hd4/opt/bash/NASPing.sh: /mnt/hd4/opt/bash/NASPing.sh: 10: Syntax error: end of file unexpected (expecting "fi")
Foxsat-HDR~#
Foxsat-HDR~#

Oh darn it, I've run out of time. Got to to DASH ... get it ;)
 
I have to stop you at line 1 though as no such directory exists on the Foxsat so I removed it yesterday from the mount and unmount files just to get it to work. There is a sh link to nowhere in /bin.
It was meant as a generic Linux example, not a specific Foxsat thing. Where does /bin/sh point to then? I'd have thought almost every Linux on the planet had that valid, but I no longer have access to a Foxsat to check.
The rest of your stuff seems to suffer from typos or something (as well as residual C style coding).
 
Back
Top