tag:blogger.com,1999:blog-6922719475190616477.post2924186582955878585..comments2024-03-27T08:51:49.124+01:00Comments on Tech stuff: Remote Power off the CH3WNASMichaëlhttp://www.blogger.com/profile/12582053064068588476noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-6922719475190616477.post-15551284250385635372010-01-23T20:04:20.455+01:002010-01-23T20:04:20.455+01:00Not that it matters much here, but note that "...Not that it matters much here, but note that "-eq" is a numerical (integer) match, while you probably want to do a string match using "=": if [ "$line" = "0" ]<br /><br />I have an idea that *might* make for a simpler solution (I don't have this device to try it out on): If whatever checks for /tmp/shutdown actually checks if /tmp/shutdown is a file (for instance using test -f), you can create a soft link /tmp/shutdown that points to a non-existing file in a shared folder. test -f will try to follow the link and return "false". Once someone creates the file in the shared folder, -f will return true. So no need for netcat, just create the "magic" file to shut it down.<br /><br />So in the startup script (fun_plug) add <b> rm /mnt/HDXX/your-shared-folder/shutmedownmagic; ln -s /tmp/shutdown /mnt/HDXX/your-shared-folder/shutmedownmagic</b><br /><br />Warning: If the link to a non-existing file still triggers the shutdown, it can be tricky to get rid of that line in fun_plug, so try it out by hand before adding it to fun_plug!<br /><br />Cheers, TormodAnonymousnoreply@blogger.com