[19. April 2013] A-400 Advanced Network Setup now available | [11 Jan. 2013] Customize your A-400 Home Screen

Firmware: A-400 [13 May 2013] | C-300 [30 Nov. 2012] | A-300 [30 Nov. 2012] | C-200 [21 Jan. 2013] | A-200/A-210 [10 Aug. 2012]

Just got your NMT | WIKI has the answers | Search the forum | Forum Rules/Policy | Firmware & Official NMT News | Popcornhour manuals



User(s) browsing this thread: 1 Guest(s)
Post Reply 
[200] Script request... or advice on how i can automount NAS
05-30-2011, 05:10 PM
Post: #1
Script request... or advice on how i can automount NAS
Hey pplz,

I run an A200 with 2TB + Nas with 4TB
Im running yamj however when i want to watch the NAS movies i need to browse to the nas and then go back to my movie screen in order to mount the NAS each time (as suggested by Omertron)

Is there a script out there that will automount my NAS every time i boot so that i dont ahve to exit out of yamj to do this???

-PCH A200 + 2TB WDEARS internal - NTFS
-4GB micro usb - NMT Apps
-Netgear Stora 4TB (2 x 2TB WDEARX)
-Panasonic 42" Plasma
-YAMJ w/ Unique Black Glas.Heart
Find all posts by this user
Add Thank You Quote this message in a reply
05-30-2011, 06:58 PM (This post was last modified: 05-31-2011 12:05 PM by MikeHunter.)
Post: #2
RE: Script request... or advice on how i can automount NAS
Maybe there exists better scripts - this is the one i use:

mymount.cgi in root dir (don't forget chmod 777)
Code:
#!/bin/sh

echo "Content-type: text/html";
echo "";
echo "Please be patient when mounting nas volumes:";
echo "<br>";
mymount() {
  mkdir -p "$2"
  /bin/mount -t cifs "$1" "$2" -o username=nmt,password=1234
  ls -a "$2";
  echo "<br>";
};
###############
### Mount NAS ###
###############
echo "nas volumes:";
echo "<br>";
mymount "//192.168.xxx.yyy/Volume_1/Video/nas_v1" "/opt/sybhttpd/localhost.drives/SATA_DISK/Video/nas_v1";
mymount "//192.168.xxx.yyy/Volume_2/Video/nas_v2" "/opt/sybhttpd/localhost.drives/SATA_DISK/Video/nas_v2";
echo "<br>";
echo "ready!<br>";
echo "Press <A href="http://localhost.drives:8883/SATA_DISK/Oversight.html"><STRONG>Start Oversight</STRONG></A>";
exit 0;

to start direct from TV - a second file is needed (.html)
&gt = > // &lt = <

Code:
<HTML>
<HEAD>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<BODY vLink=#000000 aLink=#0000ff link=#000000 bgColor=#ffffff>
<P align=center><BR>
<IMG src="icons/mount/pch-logo.gif">
<BR>
<FONT size=6><FONT color=#000000>

Mounting a NFS Share takes some time!!!<BR>
Please be patient for a minute.<BR>
<BR>
Press <A href="http://localhost.drives:8883/SATA_DISK/mymount.cgi"><STRONG>Enter</STRONG></A> to start mounting the NFS share.<BR>
Press the <STRONG>Home</STRONG> key when finished.<BR>
</FONT></FONT>
(some file listing info might appear on the screen)<BR>
<!--<div><font size=1>1</font>
<IMG src="icons/mount/pch.jpg">
</div>
<div><font size=1>2</font>
<IMG src="icons/mount/pch.jpg">
</div>
<div><font size=1>3</font> -->
<IMG src="icons/mount/pch.jpg">
<!-- </div> -->
<IMG src="icons/mount/dns323.jpg">    
</FONT></FONT>
</P>
</BODY>
</HTML>
(the images aren't nessesary)

if you like to automount on each startup:
add this line into the start_app.sh in root dir (only if nmt apps are installed)
Code:
./mymount.cgi >/share/logfile.txt

maybe this line is needed instead
Code:
/opt/sybhttpd/localhost_drives/SATA_DISK/mymount.cgi >/share/logfile.txt

C-200 @50'' Panasonic TH-50PX8EA
(BR, 2,5''HDD 500GB, LAN)
A-110 @42'' LG LED-TV
(3,5''HDD 1TB, LAN)
CH3SNAS 1TB+500GB, DNS-323 2x2TB,
ACER WHS H-340 1TB
!! VOTE FOR !! multiple switchable external subtitles (srt)
Find all posts by this user
Add Thank You Quote this message in a reply
05-30-2011, 06:59 PM
Post: #3
RE: Script request... or advice on how i can automount NAS
most save the jukebox on their nas so they have to mount it in order to start yamj and it's ready to play everything. which skin are you using?
Find all posts by this user
Add Thank You Quote this message in a reply
05-31-2011, 08:34 AM
Post: #4
RE: Script request... or advice on how i can automount NAS
thanks mike. thats a bit over my head but ill ahve a read throuhg and try to make it work for me

@mike. Would this cause errors if my NAS was NOT turned on?

@accident: Unique black glas. The reason yamj isnt on my NAS is that the nas is for all the 'old stuff' and shows i dont watch ever but want to keep incase i want to watch them/pplz come over and we watch a few episodes etc

The nas is noisy and frankly i didnt think the idea of having a HDD NAS on full time when i prob will use it once a month is worth while.

I also use it for other reasons therefore it turns on at 5pm and off at midnight each day which is when i re-run yamj each day (in that gap)

Generally if we watching during the day i wont be using the nas but if i ever do i want it to be available to use (or the WIFE to use... as she wont get the whole 'mounting thing' and ill get calls at work!!!)

-PCH A200 + 2TB WDEARS internal - NTFS
-4GB micro usb - NMT Apps
-Netgear Stora 4TB (2 x 2TB WDEARX)
-Panasonic 42" Plasma
-YAMJ w/ Unique Black Glas.Heart
Find all posts by this user
Add Thank You Quote this message in a reply
05-31-2011, 12:03 PM
Post: #5
RE: Script request... or advice on how i can automount NAS
error won't be shown on the big screen - but should be viewable in the logfile.txt

C-200 @50'' Panasonic TH-50PX8EA
(BR, 2,5''HDD 500GB, LAN)
A-110 @42'' LG LED-TV
(3,5''HDD 1TB, LAN)
CH3SNAS 1TB+500GB, DNS-323 2x2TB,
ACER WHS H-340 1TB
!! VOTE FOR !! multiple switchable external subtitles (srt)
Find all posts by this user
Add Thank You Quote this message in a reply
05-31-2011, 12:11 PM (This post was last modified: 05-31-2011 12:15 PM by accident.)
Post: #6
RE: Script request... or advice on how i can automount NAS
reading over what your trying to do, your going to have issues because your nas is not always on. It's going to unmount when that happens..

I'm not sure if unique has this feature but other skins do:

1: Setup a user/exit button to exit to the pch menu with the nas url. This SHOULD cause it to mount. Then when you need it mounted, just press your special button to mount, then back to return to yamj where you left off.

2: There is some threads around here using etherwake to wake up a nas. If you nas supports wake on lan you could do the same button but have it connect to a little php script. That script could call etherwake to wake up your nas, hidden to you mount it, and then redirect you back into yamj (or give you a success/fail message).

3: use a skin/jukebox that supports mount on demand.

4: syabas keeps saying multimounts is coming but nobody knows how they will work.. it's possible in a few weeks you'll not need a special solution.
Find all posts by this user
Add Thank You Quote this message in a reply
09-03-2011, 03:05 PM
Post: #7
RE: Script request: startup script
Hi guys,

I often read about a startup script start_app.sh or startscript.sh but somehow, this doesn't seem to run on my PCM A-210.
I tried different folders like root (doesn't survive a reboot), /nmt and /share and root of connected USB drive.
Can somebody give me the precise filename & folder where to place the startup script?

Thanx!

Eylard
Find all posts by this user
Add Thank You Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  [100/200/300/400] Cross Compile Request Thread - For all NMT Series vaidyasr 30 6,323 Today 02:59 AM
Last Post: studlee2
  [400] start up script lil8386 20 894 04-17-2013 06:53 PM
Last Post: jhmiller
  [300/400] iMediaShare App Request teslafied 0 329 03-18-2013 04:12 PM
Last Post: teslafied
  [400] how to launch a script when an HW event detected like USB disk insert or detach ? got_rice76 1 465 03-18-2013 11:35 AM
Last Post: vaidyasr
  [400] Wake Nas from A400 Stoke192 5 579 01-29-2013 07:07 PM
Last Post: Stoke192
  [200] [request] mopidy of despotify to enable spotify dizz-e 0 604 12-24-2012 10:00 PM
Last Post: dizz-e
  [200] script for turn off service wta12 4 682 10-18-2012 09:37 AM
Last Post: jhmiller
  [300] Request: Dutch 'Uitzending Gemist' Mr_Popcorn 5 2,045 04-05-2012 09:28 PM
Last Post: 1noname
  [200] Sportsdevil Request gusmin 5 1,101 03-04-2012 09:00 PM
Last Post: Atinkler
  [300] [REQUEST] backup tool accident 0 710 01-26-2012 06:55 AM
Last Post: accident

Forum Jump: