aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/dashboard/dashboard.inc20
-rw-r--r--packages/dashboard/dashboard.xml29
2 files changed, 49 insertions, 0 deletions
diff --git a/packages/dashboard/dashboard.inc b/packages/dashboard/dashboard.inc
new file mode 100644
index 00000000..fefb8e03
--- /dev/null
+++ b/packages/dashboard/dashboard.inc
@@ -0,0 +1,20 @@
+<?php
+
+function dashboard_install() {
+ global $g, $config;
+ if(!file_exists("/usr/local/www/index.php.before_dashboard")) {
+ /* backup the pre-dashboard index.php file */
+ mwexec("cp /usr/local/www/index.php /usr/local/www/index.php.before_dashboard");
+ }
+ mwexec("tar xzvpf -C /usr/local/www/ /usr/local/pkg/widgets.tgz");
+}
+
+function dashboard_deinstall() {
+ global $g, $config;
+ if(file_exists("/usr/local/www/index.php.before_dashboard")) {
+ /* restore the file prior to the dashboard package installation */
+ mwexec("cp /usr/local/www/index.php.before_dashboard /usr/local/www/index.php");
+ }
+}
+
+?> \ No newline at end of file
diff --git a/packages/dashboard/dashboard.xml b/packages/dashboard/dashboard.xml
new file mode 100644
index 00000000..7f94bc09
--- /dev/null
+++ b/packages/dashboard/dashboard.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<packagegui>
+ <title>Dashboard</title>
+ <name>dashboard</name>
+ <version>0.1</version>
+ <additional_files_needed>
+ <prefix>/usr/local/pkg/</prefix>
+ <chmod>077</chmod>
+ <item>http://www.pfsense.com/packages/config/dashboard/dashboard.inc</item>
+ </additional_files_needed>
+ <additional_files_needed>
+ <prefix>/usr/local/pkg/</prefix>
+ <chmod>077</chmod>
+ <item>http://www.pfsense.com/packages/config/dashboard/binaries/widgets.tgz</item>
+ </additional_files_needed>
+ <custom_php_install_command>
+ dashboard_install();
+ </custom_php_install_command>
+ <custom_add_php_command>
+ </custom_add_php_command>
+ <custom_php_resync_command>
+ </custom_php_resync_command>
+ <custom_php_deinstall_command>
+ dashboard_deinstall();
+ </custom_php_deinstall_command>
+</packagegui>
+
+
+ \ No newline at end of file