diff options
author | James Meyer <james.meyer@operamail.com> | 2012-09-20 21:11:14 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2012-09-20 21:11:14 (GMT) |
commit | 82fbaf24ecc0374bd5dd457c118e1a0affffaa83 (patch) | |
tree | 5233f1c70d6008be4834c9006fc2a911f17b8d53 /abs/core/supplemental-web | |
parent | 24f531c22f8c07112d4d71ae37f6f65a85f6e815 (diff) | |
download | linhes_pkgbuild-82fbaf24ecc0374bd5dd457c118e1a0affffaa83.zip linhes_pkgbuild-82fbaf24ecc0374bd5dd457c118e1a0affffaa83.tar.gz linhes_pkgbuild-82fbaf24ecc0374bd5dd457c118e1a0affffaa83.tar.bz2 |
supplemental-web: add ability to list all known exported file systems
Diffstat (limited to 'abs/core/supplemental-web')
-rw-r--r-- | abs/core/supplemental-web/PKGBUILD | 4 | ||||
-rwxr-xr-x | abs/core/supplemental-web/contents/exports.shtml | 20 | ||||
-rw-r--r-- | abs/core/supplemental-web/contents/links.html | 1 | ||||
-rwxr-xr-x | abs/core/supplemental-web/contents/list_exports.py | 82 | ||||
-rw-r--r-- | abs/core/supplemental-web/lighttpd-supplement.conf | 2 | ||||
-rw-r--r-- | abs/core/supplemental-web/supplemental-web.install | 2 |
6 files changed, 107 insertions, 4 deletions
diff --git a/abs/core/supplemental-web/PKGBUILD b/abs/core/supplemental-web/PKGBUILD index c9671de..311292f 100644 --- a/abs/core/supplemental-web/PKGBUILD +++ b/abs/core/supplemental-web/PKGBUILD @@ -1,6 +1,6 @@ pkgname=supplemental-web pkgver=1.0 -pkgrel=19 +pkgrel=25 arch=('i686' 'x86_64') MVDIR=$startdir/pkg/usr/MythVantage install=supplemental-web.install @@ -32,6 +32,6 @@ build() { } -md5sums=('30aa4235aff78c77d544f930f3d92b62' +md5sums=('400abe98c97848f8b12c5eb111ac47e4' '3d8c7b430c1319d706ca420825918d2a' '81cdb6ee6804fa36366c6e259a80e7b4') diff --git a/abs/core/supplemental-web/contents/exports.shtml b/abs/core/supplemental-web/contents/exports.shtml new file mode 100755 index 0000000..9a26dc9 --- /dev/null +++ b/abs/core/supplemental-web/contents/exports.shtml @@ -0,0 +1,20 @@ +<html> +<head> +<style type="text/css">@import "/frame.css";</style> +</head> + +<body> +<div id="mainContainer"> +<!-- <div id="header"><p></p></div> + <div id="content"> + <p></p>--> + + <!--#exec cmd="/data/srv/httpd/htdocs/list_exports.py" --> + + +</br> +</br> + +</body> +</html> + diff --git a/abs/core/supplemental-web/contents/links.html b/abs/core/supplemental-web/contents/links.html index cfc7311..883c273 100644 --- a/abs/core/supplemental-web/contents/links.html +++ b/abs/core/supplemental-web/contents/links.html @@ -24,6 +24,7 @@ Other Links <li><a href="http://forums.linhes.org" >Online User Forums</a></li> <li><a href="http://www.mythtv.org" >mythtv.org</a></li> <li><a href="http://smolt.mythtv.org" >mythtv smolt server</a></li> + <li><a href="/exports.shtml" >List file shares </a></li> </ul> diff --git a/abs/core/supplemental-web/contents/list_exports.py b/abs/core/supplemental-web/contents/list_exports.py new file mode 100755 index 0000000..13ec690 --- /dev/null +++ b/abs/core/supplemental-web/contents/list_exports.py @@ -0,0 +1,82 @@ +#!/usr/bin/python2 +import subprocess + +def nfs_export_list(): + nfslist = [] + exportfile = "/etc/exports" + proc = subprocess.Popen(["showmount", "-a"] , stdout=subprocess.PIPE,stderr=subprocess.PIPE) + stdout,stderr = proc.communicate() + rc = proc.returncode + if rc == 0: + try: + f = open(exportfile,"r") + for line in f.readlines(): + if line.startswith("#"): + continue + item = line.split() + if len(item) <= 1 : + continue + nfslist.append(item) + except : + pass + else: + nfslist.append(["NFS server is not running",'NFS server is not running']) + return nfslist + + +def smb_share_list(): + smblist=[] + + proc = subprocess.Popen(["smbclient", "-L", "\\localhost" , "-N"], stdout=subprocess.PIPE,stderr=subprocess.PIPE) + stdout,stderr = proc.communicate() + outstuff = stderr.split("\n") + for line in outstuff: + try: + heading1 = line.split()[0] + except: + continue + #print heading1 + #print heading1.find("Domain") + if heading1.find("Domain") > -1 : + #smblist.append('') + smblist.append(heading1) + break + + outstuff = stdout.split("\n") + for line in outstuff: + try: + heading1,heading2 = line.split() + except: + continue + if heading1 == "Server" and heading2 == "Comment": + break + smblist.append(line) + + return smblist + + +nfslist = nfs_export_list() +smblist = smb_share_list() + + +print "---------NFS SHARES-----------\n" +print "</br>" +for sharename in nfslist: + if sharename[1].find("noaccess") > -1 : + print "%s \t no access" %sharename[0] + print "</br>" + else: + print sharename[0] + print "</br>" + +print "\n---------SMB SHARES----------\n" +print "</br>" + +if len(smblist) == 0: + print "Samba is not running or no shares listed" + print "</br>" +else: + for sharename in smblist: + print "%s" %(sharename.split()[0]) + print "</br>" + diff --git a/abs/core/supplemental-web/lighttpd-supplement.conf b/abs/core/supplemental-web/lighttpd-supplement.conf index 24e1b4a..a07564a 100644 --- a/abs/core/supplemental-web/lighttpd-supplement.conf +++ b/abs/core/supplemental-web/lighttpd-supplement.conf @@ -41,7 +41,7 @@ dir-listing.external-css = "/frame.css" $SERVER["socket"] == ":1337" { server.document-root = "/data/srv/httpd/cgi/" - alias.url = ( "/templates/" => "/data/home/mythtv/templates/" ) + alias.url = ( "/templates/" => "/home/mythtv/templates/" ) } diff --git a/abs/core/supplemental-web/supplemental-web.install b/abs/core/supplemental-web/supplemental-web.install index 7dc0214..eec33fd 100644 --- a/abs/core/supplemental-web/supplemental-web.install +++ b/abs/core/supplemental-web/supplemental-web.install @@ -8,7 +8,7 @@ pre_install() { # arg 1: the new package version post_install() { - /bin/true + setfacl -m u:http:rx /home/mythtv/ COUNT=`grep -c "lighttpd-supplement.conf" /etc/lighttpd/conf.include` if [ $COUNT == 0 ] |