summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2009-02-25 18:21:27 +0000
committerTed Trask <ttrask01@yahoo.com>2009-02-25 18:21:27 +0000
commit555fd1d7632bd06116a72aaa764e73073dcd3721 (patch)
treee8caf529f597977720b2a6cfcead4c487cfc35bf
downloadacf-pingu-0.1.0.tar.bz2
acf-pingu-0.1.0.tar.xz
Added pingu ACF.v0.1.0
git-svn-id: svn://svn.alpinelinux.org/acf/pingu/trunk@1706 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r--Makefile44
-rw-r--r--README1
-rw-r--r--config.mk10
-rw-r--r--pingu-controller.lua18
l---------pingu-expert-html.lsp1
-rw-r--r--pingu-model.lua35
l---------pingu-startstop-html.lsp1
l---------pingu-status-html.lsp1
-rw-r--r--pingu.menu3
-rw-r--r--pingu.roles3
10 files changed, 117 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..458b71a
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,44 @@
+APP_NAME=pingu
+PACKAGE=acf-$(APP_NAME)
+VERSION=0.1.0
+
+APP_DIST=\
+ pingu* \
+
+
+EXTRA_DIST=README Makefile config.mk
+
+DISTFILES=$(APP_DIST) $(EXTRA_DIST)
+
+TAR=tar
+
+P=$(PACKAGE)-$(VERSION)
+tarball=$(P).tar.bz2
+install_dir=$(DESTDIR)/$(appdir)/$(APP_NAME)
+
+all:
+clean:
+ rm -rf $(tarball) $(P)
+
+dist: $(tarball)
+
+install:
+ mkdir -p "$(install_dir)"
+ cp -a $(APP_DIST) "$(install_dir)"
+
+$(tarball): $(DISTFILES)
+ rm -rf $(P)
+ mkdir -p $(P)
+ cp -a $(DISTFILES) $(P)
+ $(TAR) -jcf $@ $(P)
+ rm -rf $(P)
+
+# target that creates a tar package, unpacks is and install from package
+dist-install: $(tarball)
+ $(TAR) -jxf $(tarball)
+ $(MAKE) -C $(P) install DESTDIR=$(DESTDIR)
+ rm -rf $(P)
+
+include config.mk
+
+.PHONY: all clean dist install dist-install
diff --git a/README b/README
new file mode 100644
index 0000000..db75114
--- /dev/null
+++ b/README
@@ -0,0 +1 @@
+ACF for pingu
diff --git a/config.mk b/config.mk
new file mode 100644
index 0000000..45f4d21
--- /dev/null
+++ b/config.mk
@@ -0,0 +1,10 @@
+prefix=/usr
+datadir=${prefix}/share
+sysconfdir=${prefix}/etc
+localstatedir=${prefix}/var
+acfdir=${datadir}/acf
+wwwdir=${acfdir}/www
+cgibindir=${acfdir}/cgi-bin
+appdir=${acfdir}/app
+acflibdir=${acfdir}/lib
+sessionsdir=${localstatedir}/lib/acf/sessions
diff --git a/pingu-controller.lua b/pingu-controller.lua
new file mode 100644
index 0000000..d4c7437
--- /dev/null
+++ b/pingu-controller.lua
@@ -0,0 +1,18 @@
+module(..., package.seeall)
+
+-- Load libraries
+require("controllerfunctions")
+
+default_action = "status"
+
+function status(self)
+ return self.model.getstatus()
+end
+
+function startstop(self)
+ return controllerfunctions.handle_startstop(self, self.model.startstop_service, self.model.getstatus, self.clientdata)
+end
+
+function expert(self)
+ return controllerfunctions.handle_form(self, self.model.get_filedetails, self.model.update_filedetails, self.clientdata, "Save", "Edit Pingu Config", "Configuration Set")
+end
diff --git a/pingu-expert-html.lsp b/pingu-expert-html.lsp
new file mode 120000
index 0000000..207f324
--- /dev/null
+++ b/pingu-expert-html.lsp
@@ -0,0 +1 @@
+../expert-html.lsp \ No newline at end of file
diff --git a/pingu-model.lua b/pingu-model.lua
new file mode 100644
index 0000000..75f26e2
--- /dev/null
+++ b/pingu-model.lua
@@ -0,0 +1,35 @@
+module(..., package.seeall)
+
+-- Load libraries
+require("modelfunctions")
+require("fs")
+require("format")
+
+-- Set variables
+local configfile = "/etc/pingu.conf"
+local processname = "pingu"
+local packagename = "pingu"
+
+local path = "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin "
+
+-- ################################################################################
+-- LOCAL FUNCTIONS
+
+-- ################################################################################
+-- PUBLIC FUNCTIONS
+
+function startstop_service(action)
+ return modelfunctions.startstop_service(processname, action)
+end
+
+function getstatus()
+ return modelfunctions.getstatus(processname, packagename, "Pingu Status")
+end
+
+function get_filedetails()
+ return modelfunctions.getfiledetails(configfile)
+end
+
+function update_filedetails(filedetails)
+ return modelfunctions.setfiledetails(filedetails, {configfile})
+end
diff --git a/pingu-startstop-html.lsp b/pingu-startstop-html.lsp
new file mode 120000
index 0000000..0ea2627
--- /dev/null
+++ b/pingu-startstop-html.lsp
@@ -0,0 +1 @@
+../startstop-html.lsp \ No newline at end of file
diff --git a/pingu-status-html.lsp b/pingu-status-html.lsp
new file mode 120000
index 0000000..b2f8480
--- /dev/null
+++ b/pingu-status-html.lsp
@@ -0,0 +1 @@
+../status-html.lsp \ No newline at end of file
diff --git a/pingu.menu b/pingu.menu
new file mode 100644
index 0000000..7ea08f2
--- /dev/null
+++ b/pingu.menu
@@ -0,0 +1,3 @@
+#CAT GROUP/DESC TAB ACTION
+Networking 95Pingu Status status
+Networking 95Pingu Expert expert
diff --git a/pingu.roles b/pingu.roles
new file mode 100644
index 0000000..cd613b9
--- /dev/null
+++ b/pingu.roles
@@ -0,0 +1,3 @@
+USER=pingu:status,pingu:startstop
+EXPERT=pingu:expert
+ADMIN=pingu:status,pingu:startstop,pingu:expert