From 06f4a1b3a58e15c258151f9889180a43167f8522 Mon Sep 17 00:00:00 2001 From: crestAT Date: Sat, 16 Jul 2016 08:24:23 +0200 Subject: [PATCH] b6 recognition of extensions without GUI / config.xml entries --- .../onebuttoninstaller/mcommander.postinit | 13 ++++++++++ onebuttoninstaller/ext/onebuttoninstaller.php | 26 ++++++++++++++----- onebuttoninstaller/extensions.txt | 11 ++++---- .../onebuttoninstaller-install.php | 3 ++- onebuttoninstaller/release_notes.txt | 1 + onebuttoninstaller/version.txt | 2 +- 6 files changed, 42 insertions(+), 14 deletions(-) create mode 100644 onebuttoninstaller/ext/ext/onebuttoninstaller/mcommander.postinit diff --git a/onebuttoninstaller/ext/ext/onebuttoninstaller/mcommander.postinit b/onebuttoninstaller/ext/ext/onebuttoninstaller/mcommander.postinit new file mode 100644 index 0000000..bfe902a --- /dev/null +++ b/onebuttoninstaller/ext/ext/onebuttoninstaller/mcommander.postinit @@ -0,0 +1,13 @@ + diff --git a/onebuttoninstaller/ext/onebuttoninstaller.php b/onebuttoninstaller/ext/onebuttoninstaller.php index bed2f27..c271d19 100644 --- a/onebuttoninstaller/ext/onebuttoninstaller.php +++ b/onebuttoninstaller/ext/onebuttoninstaller.php @@ -49,7 +49,7 @@ $loginfo = array( "type" => "plain", "pattern" => "/^(.*)###(.*)###(.*)###(.*)###(.*)###(.*)###(.*)$/", "columns" => array( - array("title" => gettext("Extensions"), "class" => "listlr", "param" => "align=\"left\" valign=\"middle\" nowrap", "pmid" => 0), + array("title" => gettext("Extension"), "class" => "listlr", "param" => "align=\"left\" valign=\"middle\" nowrap", "pmid" => 0), array("title" => gettext("Version"), "class" => "listr", "param" => "align=\"center\" valign=\"middle\"", "pmid" => 1), array("title" => gettext("Description"), "class" => "listr", "param" => "align=\"left\" valign=\"middle\"", "pmid" => 5), array("title" => gettext("Install"), "class" => "listr", "param" => "align=\"center\" valign=\"middle\"", "pmid" => 4) @@ -64,6 +64,17 @@ function log_get_contents($logfile) { return $content; } +function log_get_status($cmd_entry) { + global $config; + $i =0; + if ( is_array($config['rc']['postinit'] ) && is_array( $config['rc']['postinit']['cmd'] ) ) { + for ($i; $i < count($config['rc']['postinit']['cmd']);) { if (preg_match("/$cmd_entry/", $config['rc']['postinit']['cmd'][$i])) break; ++$i; } + } +//echo($cmd_entry." $i - "); + if ($i == count($config['rc']['postinit']['cmd'])) return 0; // 0 = no entry, extension is not installed + else return 1; // 1 = entry found, extension is already installed +} + function log_display($loginfo) { global $g; global $config; @@ -110,15 +121,15 @@ function log_display($loginfo) { // architectures: x86, x64, rpi // platforms: embedded, full, livecd, liveusb if (!empty($result[6]) && ((strpos($result[6], $g['arch']) !== false) || (strpos($result[6], $g['platform']) !== false))) { - echo " \n"; + echo " \n"; } else { - // check if extension is already installed (existing config.xml entry or, for command line tools, based on installation directory) - if ((isset($config[$result[2]])) || ((strpos($result[2], "/") == 0) && (is_dir("{$config['onebuttoninstaller']['storage_path']}{$result[2]}")))){ + // check if extension is already installed (existing config.xml or postinit cmd entry) + if ((isset($config[$result[2]])) || (log_get_status($result[2]) == 1)) { echo " \n"; } else { // data for installation - echo " + echo " @@ -197,7 +208,10 @@ bindtextdomain("nas4free", "/usr/local/share/locale-obi"); ?> log_display($loginfo[$log]); ?> -
+
+ ".gettext("Some extensions need to finish their installation procedures on their own extension page before they will be shown as installed!")."");?> +
+
" value="" onclick="return confirm('')" /> " value="" />
diff --git a/onebuttoninstaller/extensions.txt b/onebuttoninstaller/extensions.txt index 7695596..1c9c790 100644 --- a/onebuttoninstaller/extensions.txt +++ b/onebuttoninstaller/extensions.txt @@ -3,9 +3,8 @@ Downloady###RELEASE
0.1
###downloady###mkdir -p dow RRDGraphs###RELEASE
0.3.2
###rrdgraphs###mkdir -p rrdgraphs && cd rrdgraphs && fetch https://raw.github.com/crestAT/nas4free-rrdtool/master/rrdgraphs/rrd-install.php && chmod 770 rrd*install.php###rrdgraphs/rrd-install.php###Extension to install / configure / update and remove RRDTool based graphs for NAS4Free servers.

The extension is based on RRDtool and provides graphs for CPU frequency, CPU temperature, CPU usage, Disk usage (recognition of all mountpoints/shares automatically at RRDG startup), Load averages, Memory usage, Network latency, Network traffic, Processes, UPS, Uptime and ZFS ARC.

The extension is compatible with all versions (9.1.x - 10.x) of NAS4Free except on ARM boxes and works on all plattforms (x86 & x64, embedded & full), does not need jail or pkg_add, add pages to NAS4Free Web GUI extensions, features configuration and extension maintenance (update & removal inside the WebGUI) and is able to work on RAM drives to take care of your HDDs/USB pen drives.

Read more ... NAS4Free Forum BitTorrent Sync###RELEASE
0.7
###btsync###fetch https://raw.github.com/crestAT/nas4free-bittorrent-sync/master/bts-install.php && chmod 770 bts*install.php###bts-install.php###Extension to install / configure / backup / update / manage and remove BitTorrent Sync application on NAS4Free servers.

The extension can be used with BitTorrent Sync 1.4.x (last version was 1.4.111) as well as 2.x, is compatible with all versions (9.1.x - 10.x) of NAS4Free except on ARM boxes, works on all plattforms (embedded, full), does not need jail or pkg_add, add pages to NAS4Free Web GUI extensions, features configuration, application update & backup management, extension mantenance (update & removal) and log view with filter and search capability.

Note: Standard BitTorrent Sync version is based on 2.x releases, to use the latest 1.x release open Extensions | BitTorrent Sync | Maintenance and change the Download URL for version 1.4.111:
64 bit: http://syncapp.bittorrent.com/1.4.111/btsync_freebsd_x64-1.4.111.tar.gz
32 bit: http://syncapp.bittorrent.com/1.4.111/btsync_freebsd_i386-1.4.111.tar.gz
and hit Save URL, Fetch and Install.


Read more ... NAS4Free Forum###rpi, rpi2 Syncthing###RELEASE
0.1.5
###syncthing###fetch https://raw.github.com/crestAT/nas4free-syncthing/master/stg-install.php && chmod 770 stg*install.php###stg-install.php###Extension to install / configure / backup / update / manage and remove Syncthing (STG) application on NAS4Free (N4F) servers.

The extension works on all plattforms, does not need jail or pkg_add, add pages to NAS4Free WebGUI extensions, features configuration, application update & backup management, scheduling and log view with filter / search capabilities.

Read more ... NAS4Free Forum###rpi, rpi2 -TheBrig###RELEASE
0.94
###thebrig###mkdir -p thebrig && cd thebrig && fetch https://raw.githubusercontent.com/fsbruva/thebrig/alcatraz/thebrig_install.sh && chmod a+x thebrig_install.sh && sh thebrig_install.sh###-###Jail manager extension for NAS4Free.

Note: After the installation navigate to rudimentary config tab and push Save to finish the installation.

Read more ... NAS4Free Forum -DNSMasq DHCP Server###BETA
0.2
###dnsmasq###mkdir -p dnsmasq && cd dnsmasq && fetch https://raw.github.com/alexey1234/nas4free-dnsmasq/master/dnsmasq_install.sh && chmod a+x dnsmasq_install.sh && sh dnsmasq_install.sh `pwd`###-###DNSMasq DHCP Server extension for NAS4Free.

Read more ... NAS4Free Forum###rpi, rpi2 -Midnight Commander###RELEASE
2015-02-21
###/midnightcommander###mkdir -p midnightcommander && cd midnightcommander && cp /usr/local/www/ext/onebuttoninstaller/mcommander.sh . && echo "copy OK" && chmod u+x mcommander.sh && echo "chmod OK" && `pwd`/mcommander.sh###-###Midnight Commander for NAS4Free.

After the successful installation you can use Midnight Commander in the system console shell or if you connect via ssh. To start the Midnight Commander just enter the command mc in the CLI.

Read more ... NAS4Free Forum###rpi, rpi2 -Bhyve###BETA
0.x
###bhyve###mkdir -p bhyve && cd bhyve && fetch https://raw.githubusercontent.com/alexey1234/vmbhyve_nas4free/master/bhyve_install.sh && chmod a+x bhyve_install.sh && sh bhyve_install.sh `pwd`###-###WebGUI for bhyve for NAS4Free.

Note: After the installation navigate to rudimentary config tab and push Save to finish the installation.

Read more ... NAS4Free Forum -ezPlex Standard###RELEASE
4.0
###ezplex###mkdir -p plex && cd plex && ./plexinit && rehash###plex/postinit###

ATM NEEDS LOCALLY SAVED plexinit FILE!

Plex Media Server Add-On for NAS4Free 10.x.

The extension works on NAS4Free Plex Media Server Add-On for NAS4Free 10.x or compatible FreeBSD based NAS solutions, don't need jail, fstab or unionfs configs, self contained and portable package, single script for management and startup, easy to upgrade/rollback while maintaining actual Plex config, Plex IP address will be locally visible by any devices.

Note: After install simply reboot and enjoy ezPlex.

Read more ... NAS4Free Forum###x86, rpi, rpi2 -ezPlex PlexPass###RELEASE
4.0
###ezplexpass###mkdir -p plexpass && cd plexpass && tar xf ezplex-*.tgz && rm ezplex-*.tgz && ./plexinit && rehash###-###Plex Media Server Add-On for NAS4Free 10.x.

The extension works on NAS4Free 10.x or compatible FreeBSD based NAS solutions, don't need jail, fstab or unionfs configs, self contained and portable package, single script for management and startup, easy to upgrade/rollback while maintaining actual Plex config, Plex IP address will be locally visible by any devices.

Note: After install simply reboot and enjoy ezPlex.

Read more ... NAS4Free Forum###x86, x64, rpi, rpi2 +TheBrig###RELEASE
0.94
###thebrig###mkdir -p thebrig && cd thebrig && fetch https://raw.githubusercontent.com/fsbruva/thebrig/alcatraz/thebrig_install.sh && chmod a+x thebrig_install.sh && sh thebrig_install.sh###-###Jail manager extension for NAS4Free.

Note: After the installation navigate to rudimentary config tab and push Save to finish the installation.

Read more ... NAS4Free Forum +DNSMasq DHCP Server###RELEASE
0.3
###dnsmasq###mkdir -p dnsmasq && cd dnsmasq && fetch https://raw.github.com/alexey1234/nas4free-dnsmasq/master/dnsmasq_install.sh && chmod a+x dnsmasq_install.sh && sh dnsmasq_install.sh `pwd`###-###DNSMasq DHCP Server extension for NAS4Free.

Note: After the installation navigate to rudimentary config tab and push Save to finish the installation.

Read more ... NAS4Free Forum###rpi, rpi2 +Midnight Commander###RELEASE
4.8.8
###mcommander.sh###mkdir -p midnightcommander && cd midnightcommander && cp /usr/local/www/ext/onebuttoninstaller/mcommander.* . && chmod u+x mcommander.sh && `pwd`/mcommander.sh###midnightcommander/mcommander.postinit###Midnight Commander for NAS4Free.

After successful installation you can use Midnight Commander in the system console shell or if you connect via ssh. To start the Midnight Commander just enter the command mc in the CLI.

Read more ... NAS4Free Forum###rpi, rpi2 +Bhyve###BETA
0.x
###bhyve###mkdir -p bhyve && cd bhyve && fetch https://raw.githubusercontent.com/alexey1234/vmbhyve_nas4free/master/bhyve_install.sh && chmod a+x bhyve_install.sh && sh bhyve_install.sh `pwd`###-###WebGUI for bhyve for NAS4Free.

Note: After the installation navigate to rudimentary config tab and push Save to finish the installation.

Read more ... NAS4Free Forum +Plex Media Server###RELEASE
4.0
###plexinit###cd plex && ./plexinit -g ###plex/postinit###Plex Media Server Add-On for NAS4Free 10.x.

The extension works on NAS4Free Plex Media Server Add-On for NAS4Free 10.x or compatible FreeBSD based NAS solutions, don't need jail, fstab or unionfs configs, self contained and portable package, single script for management and startup, easy to upgrade/rollback while maintaining actual Plex config, Plex IP address will be locally visible by any devices.

Read more ... NAS4Free Forum###x86, rpi, rpi2 diff --git a/onebuttoninstaller/onebuttoninstaller-install.php b/onebuttoninstaller/onebuttoninstaller-install.php index d35f382..b1c31d9 100644 --- a/onebuttoninstaller/onebuttoninstaller-install.php +++ b/onebuttoninstaller/onebuttoninstaller-install.php @@ -31,6 +31,7 @@ */ /* Version Date Description +0.1-b6 2016.06.16 recognition of extensions without GUI / config.xml entries 0.1-b4 2016.04.07 2451 compatibility 0.1-b3 2016.02.06 N: add language support 0.1-b2 2016.02.02 N: check for supported architecture, plattform @@ -42,7 +43,7 @@ Version Date Description 0.1-a1 2016.01.16 initial release */ -$v = "v0.1-b4"; // extension version +$v = "v0.1-b6"; // extension version $appname = "OneButtonInstaller"; require_once("config.inc"); diff --git a/onebuttoninstaller/release_notes.txt b/onebuttoninstaller/release_notes.txt index a66e20f..6c376ca 100644 --- a/onebuttoninstaller/release_notes.txt +++ b/onebuttoninstaller/release_notes.txt @@ -1,4 +1,5 @@ Version Date Description +0.1-b6 2016.06.16 recognition of extensions without GUI / config.xml entries 0.1-b4 2016.04.07 2451 compatibility 0.1-b3 2016.02.06 N: add language support 0.1-b2 2016.02.01 N: check for supported architecture, plattform diff --git a/onebuttoninstaller/version.txt b/onebuttoninstaller/version.txt index 11141b7..c1ed2ad 100644 --- a/onebuttoninstaller/version.txt +++ b/onebuttoninstaller/version.txt @@ -1 +1 @@ -0.1-b4 +0.1-b6