root/branches/communities/jamendo/scripts/quickinstall.py

Revision 29, 0.8 kB (checked in by sylvinus, 21 months ago)

First import of prototype Jamendo application

  • Property svn:mime-type set to text/plain
Line 
1import sys,os
2
3fonera = "root@192.168.10.1:"
4pwd = "admin"
5
6module = sys.argv[1]
7
8if (not os.path.isdir(module)) or (not os.path.isdir(os.path.join(module,"luasrc"))):
9    print "%s is not a luci app" % module
10    sys.exit(0)
11   
12   
13def scp_dir_to_fonera(local_dir,remote_dir):
14    cmd = "expect -c 'set timeout 10; spawn sh -c \"scp -r %s/* %s%s\" ; expect \"password\: \";send \"%s\n\"; interact'" % (local_dir,fonera,remote_dir,pwd)
15    os.system(cmd)
16
17dir_luasrc = os.path.join(module,"luasrc")
18dir_htdocs = os.path.join(module,"htdocs")
19dir_root = os.path.join(module,"root")
20
21if os.path.isdir(dir_luasrc):
22    scp_dir_to_fonera(dir_luasrc,"/usr/lib/lua/luci/")
23
24if os.path.isdir(dir_htdocs):
25    scp_dir_to_fonera(dir_htdocs,"/www/")
26
27if os.path.isdir(dir_root):
28    scp_dir_to_fonera(dir_root,"/")
Note: See TracBrowser for help on using the browser.