@@ -1,12 +1,71 @@
|
||||
<?php
|
||||
/*
|
||||
fail2ban.postinit
|
||||
|
||||
Copyright (c) 2015 - 2017 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation are those
|
||||
of the authors and should not be interpreted as representing official policies,
|
||||
either expressed or implied, of the FreeBSD Project.
|
||||
*/
|
||||
|
||||
$command = "fail2ban_start.sh";
|
||||
$cmd = dirname(__FILE__)."/".$command;
|
||||
require_once("config.inc");
|
||||
require_once("functions.inc");
|
||||
if ( is_array($config['rc']['postinit'] ) && is_array( $config['rc']['postinit']['cmd'] ) ) {
|
||||
for ($i = 0; $i < count($config['rc']['postinit']['cmd']); $i++) {
|
||||
if (preg_match("/$command/", $config['rc']['postinit']['cmd'][$i])) break; }
|
||||
}
|
||||
$config['rc']['postinit']['cmd'][$i] = $config['cmd']."$cmd";
|
||||
write_config();
|
||||
|
||||
// remove start/stop commands
|
||||
// remove existing old rc format entries
|
||||
if (is_array($config['rc']) && is_array($config['rc']['postinit']) && is_array( $config['rc']['postinit']['cmd'])) {
|
||||
for ($i = 0; $i < count($config['rc']['postinit']['cmd']); ++$i) {
|
||||
if (preg_match('/$command/', $config['rc']['postinit']['cmd'][$i])) unset($config['rc']['postinit']['cmd'][$i]);
|
||||
}
|
||||
}
|
||||
// remove existing entries for new rc format
|
||||
if (is_array($config['rc']) && is_array($config['rc']['param'])) {
|
||||
$rc_param_count = count($config['rc']['param']);
|
||||
for ($i = 0; $i < $rc_param_count; $i++) {
|
||||
if (preg_match('/$command/', $config['rc']['param'][$i]['value'])) unset($config['rc']['param'][$i]);
|
||||
}
|
||||
}
|
||||
|
||||
// check FreeBSD release
|
||||
$release = explode("-", exec("uname -r"));
|
||||
|
||||
if ($release[0] >= 11.0) { // new rc format
|
||||
// postinit command
|
||||
$rc_param = [];
|
||||
$rc_param['uuid'] = uuid();
|
||||
$rc_param['name'] = "Fail2Ban Extension";
|
||||
$rc_param['value'] = "{$cmd}";
|
||||
$rc_param['comment'] = "Start Fail2Ban";
|
||||
$rc_param['typeid'] = '2';
|
||||
$rc_param['enable'] = true;
|
||||
$config['rc']['param'][] = $rc_param;
|
||||
}
|
||||
else {
|
||||
$config['rc']['postinit']['cmd'][] = "{$cmd}";
|
||||
}
|
||||
write_config();
|
||||
?>
|
||||
|
||||
@@ -1,12 +1,72 @@
|
||||
<?php
|
||||
/*
|
||||
mcommander.postinnit
|
||||
|
||||
Copyright (c) 2015 - 2017 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation are those
|
||||
of the authors and should not be interpreted as representing official policies,
|
||||
either expressed or implied, of the FreeBSD Project.
|
||||
*/
|
||||
|
||||
require_once("config.inc");
|
||||
|
||||
$command = "mcommander.sh";
|
||||
$cmd = dirname(__FILE__)."/".$command;
|
||||
require_once("config.inc");
|
||||
require_once("functions.inc");
|
||||
if ( is_array($config['rc']['postinit'] ) && is_array( $config['rc']['postinit']['cmd'] ) ) {
|
||||
for ($i = 0; $i < count($config['rc']['postinit']['cmd']); $i++) {
|
||||
if (preg_match("/$command/", $config['rc']['postinit']['cmd'][$i])) break; }
|
||||
}
|
||||
$config['rc']['postinit']['cmd'][$i] = $config['cmd']."$cmd";
|
||||
write_config();
|
||||
|
||||
// remove start/stop commands
|
||||
// remove existing old rc format entries
|
||||
if (is_array($config['rc']) && is_array($config['rc']['postinit']) && is_array( $config['rc']['postinit']['cmd'])) {
|
||||
$rc_param_count = count($config['rc']['postinit']['cmd']);
|
||||
for ($i = 0; $i < $rc_param_count; ++$i) {
|
||||
if (preg_match("/{$command}/", $config['rc']['postinit']['cmd'][$i])) unset($config['rc']['postinit']['cmd'][$i]);
|
||||
}
|
||||
}
|
||||
// remove existing entries for new rc format
|
||||
if (is_array($config['rc']) && is_array($config['rc']['param'])) {
|
||||
$rc_param_count = count($config['rc']['param']);
|
||||
for ($i = 0; $i < $rc_param_count; $i++) {
|
||||
if (preg_match("/{$command}/", $config['rc']['param'][$i]['value'])) unset($config['rc']['param'][$i]);
|
||||
}
|
||||
}
|
||||
|
||||
// check FreeBSD release
|
||||
$release = explode("-", exec("uname -r"));
|
||||
|
||||
if ($release[0] >= 11.0) { // new rc format
|
||||
// postinit command
|
||||
$rc_param = [];
|
||||
$rc_param['uuid'] = uuid();
|
||||
$rc_param['name'] = "MidnightCommander Extension";
|
||||
$rc_param['value'] = "{$cmd}";
|
||||
$rc_param['comment'] = "Start MidnightCommander";
|
||||
$rc_param['typeid'] = '2';
|
||||
$rc_param['enable'] = true;
|
||||
$config['rc']['param'][] = $rc_param;
|
||||
}
|
||||
else {
|
||||
$config['rc']['postinit']['cmd'][] = "{$cmd}";
|
||||
}
|
||||
write_config();
|
||||
?>
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
# date: 2014-12-18 ; Update for v9.3; Clean up
|
||||
# date: 2015-02-21 ; Update mc package to mc-4.8.11.tbz
|
||||
# date: 2016-08-04 ; check hardware platform to use it on i386 too - author: crest <info@a3s.at>
|
||||
# date: 2016-11-21 ; create symlinks for v11.x compatibility - author: crest <info@a3s.at>
|
||||
#
|
||||
# purpose: Install Midnight Commander on NAS4Free (embedded version).
|
||||
# Note: Check the end of the page.
|
||||
#
|
||||
@@ -82,6 +84,9 @@ cd /usr/local/lib
|
||||
[ -e libpcre.so.3 ] || ln -s /usr/local/lib/libpcre.so.1 libpcre.so.3
|
||||
[ -e libintl.so.9 ] || ln -s /usr/local/lib/libintl.so.8 libintl.so.9
|
||||
[ -e libiconv.so.3 ] || ln -s /usr/local/lib/libiconv.so.2 libiconv.so.3
|
||||
# Symlinks for v11.x
|
||||
if [ -e /usr/lib/libssl.so.8 ]; then ln -sf /usr/lib/libssl.so.8 libssl.so.6; fi
|
||||
if [ -e /lib/libcrypto.so.8 ]; then ln -sf /lib/libcrypto.so.8 libcrypto.so.6; fi
|
||||
cd -
|
||||
|
||||
# Aliases
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
spinner.inc
|
||||
|
||||
Copyright (c) 2015 - 2016 Andreas Schmidhuber
|
||||
Copyright (c) 2015 - 2017 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Uses spin.js by Felix Gnass (fgnass) at http://spin.js.org
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
onebuttoninstaller-config.php
|
||||
|
||||
Copyright (c) 2015 - 2016 Andreas Schmidhuber
|
||||
Copyright (c) 2015 - 2017 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
onebuttoninstaller-update_extension.php
|
||||
|
||||
Copyright (c) 2015 - 2016 Andreas Schmidhuber
|
||||
Copyright (c) 2015 - 2017 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -47,14 +47,24 @@ else { $server_version = gettext("Unable to retrieve version from server!"); }
|
||||
|
||||
if (isset($_POST['ext_remove']) && $_POST['ext_remove']) {
|
||||
// remove start/stop commands
|
||||
if ( is_array($config['rc']['postinit'] ) && is_array( $config['rc']['postinit']['cmd'] ) ) {
|
||||
for ($i = 0; $i < count($config['rc']['postinit']['cmd']); $i++) {
|
||||
if (preg_match('/onebuttoninstaller/', $config['rc']['postinit']['cmd'][$i])) { unset($config['rc']['postinit']['cmd'][$i]);} else{}
|
||||
}
|
||||
// remove existing old rc format entries
|
||||
if (is_array($config['rc']) && is_array($config['rc']['postinit']) && is_array( $config['rc']['postinit']['cmd'])) {
|
||||
$rc_param_count = count($config['rc']['postinit']['cmd']);
|
||||
for ($i = 0; $i < $rc_param_count; ++$i) {
|
||||
if (preg_match('/onebuttoninstaller/', $config['rc']['postinit']['cmd'][$i])) unset($config['rc']['postinit']['cmd'][$i]);
|
||||
}
|
||||
}
|
||||
if ( is_array($config['rc']['shutdown'] ) && is_array( $config['rc']['shutdown']['cmd'] ) ) {
|
||||
for ($i = 0; $i < count($config['rc']['shutdown']['cmd']); $i++) {
|
||||
if (preg_match('/onebuttoninstaller/', $config['rc']['shutdown']['cmd'][$i])) { unset($config['rc']['shutdown']['cmd'][$i]); } else {}
|
||||
if (is_array($config['rc']) && is_array($config['rc']['shutdown']) && is_array( $config['rc']['shutdown']['cmd'])) {
|
||||
$rc_param_count = count($config['rc']['shutdown']['cmd']);
|
||||
for ($i = 0; $i < $rc_param_count; ++$i) {
|
||||
if (preg_match('/onebuttoninstaller/', $config['rc']['shutdown']['cmd'][$i])) unset($config['rc']['shutdown']['cmd'][$i]);
|
||||
}
|
||||
}
|
||||
// remove existing entries for new rc format
|
||||
if (is_array($config['rc']) && is_array($config['rc']['param'])) {
|
||||
$rc_param_count = count($config['rc']['param']);
|
||||
for ($i = 0; $i < $rc_param_count; $i++) {
|
||||
if (preg_match('/onebuttoninstaller/', $config['rc']['param'][$i]['value'])) unset($config['rc']['param'][$i]);
|
||||
}
|
||||
}
|
||||
// remove extension pages
|
||||
@@ -64,7 +74,8 @@ if (isset($_POST['ext_remove']) && $_POST['ext_remove']) {
|
||||
// unlink created links
|
||||
if (is_link("/usr/local/share/locale-obi")) unlink("/usr/local/share/locale-obi");
|
||||
// remove application section from config.xml
|
||||
if ( is_array($config['onebuttoninstaller'] ) ) { unset( $config['onebuttoninstaller'] ); write_config();}
|
||||
if (is_array($config['onebuttoninstaller'])) unset($config['onebuttoninstaller']);
|
||||
write_config();
|
||||
header("Location:index.php");
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
onebuttoninstaller.php
|
||||
|
||||
Copyright (c) 2015 - 2016 Andreas Schmidhuber
|
||||
Copyright (c) 2015 - 2017 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -82,13 +82,30 @@ function log_get_contents($logfile) {
|
||||
|
||||
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; }
|
||||
$rc_cmd_entry_found = false;
|
||||
|
||||
if (is_array($config['rc']) && is_array($config['rc']['postinit']) && is_array( $config['rc']['postinit']['cmd'])) { // old rc format
|
||||
$rc_param_count = count($config['rc']['postinit']['cmd']);
|
||||
for ($i = 0; $i < $rc_param_count; $i++) {
|
||||
if (preg_match("/{$cmd_entry}/", $config['rc']['postinit']['cmd'][$i])) {
|
||||
$rc_cmd_entry_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//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
|
||||
|
||||
if (is_array($config['rc']) && is_array($config['rc']['param'])) { // new rc format 11.x
|
||||
$rc_param_count = count($config['rc']['param']);
|
||||
for ($i = 0; $i < $rc_param_count; $i++) {
|
||||
if (preg_match("/{$cmd_entry}/", $config['rc']['param'][$i]['value'])) {
|
||||
$rc_cmd_entry_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($rc_cmd_entry_found) return 1; // 0 = no entry, extension is not installed
|
||||
else return 0; // 1 = entry found, extension is already installed
|
||||
}
|
||||
|
||||
function log_display($loginfo) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Extended GUI###<font color="green">RELEASE<br>0.5.3</font>###extended-gui###mkdir -p extended-gui/backup && mkdir -p extended-gui/log && cd extended-gui && fetch https://raw.github.com/crestAT/nas4free-extended-gui/master/extended-gui/extended-gui-install.php && chmod 770 extended-gui*install.php###extended-gui/extended-gui-install.php###Extension for NAS4Free with several improvements for the WebGUI and additional functions. Most of the extension affects STATUS | SYSTEM view but also STATUS | GRAPH and DIAGNOSTICS | LOG which got a new entry NOTIFICATIONS.<br><br>The extension works on all plattforms (x86 & x64, ARM, embedded & full), does not need jail or pkg_add, enhance pages of the NAS4Free WebGUI, features configuration and extension maintenance (update & removal inside the WebGUI), let you switch between STANDARD (original) and EXTENDED WebGUI view and let you easily configure/enable/disable views and additional functions.<br><br>Read more ... <a href='http://forums.nas4free.org/viewtopic.php?f=71&t=6405' target='_blank'>NAS4Free Forum</a>###10.3032853###
|
||||
RRDGraphs###<font color="green">RELEASE<br>0.3.3</font>###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.<br><br>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.<br><br><b><font color="red">Version 0.3.3 will be the last update for the RRDGraphs Extension since RRDGraphs goes to be native in NAS4Free 11.x series. This v0.3.3 was the base for the native implementation and all statistical data from the extension can be used further in the native NAS4Free implementation which will be called Monitoring and is located under System > Advanced. A description for the transition to native RRDGraphs can be found in the NAS4Free forum.</font></b><br><br>The extension is compatible with all versions up to 10.3 of NAS4Free 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.<br><br>Read more ... <a href='http://forums.nas4free.org/viewtopic.php?f=71&t=8299' target='_blank'>NAS4Free Forum</a>###-###
|
||||
BitTorrent Sync###<font color="green">RELEASE<br>0.7.x</font>###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.<br><br>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.<br><br><font color="blue"><b>Note:</b> 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 <b>1.4.111:</b><br><b>64 bit: </b>http://syncapp.bittorrent.com/1.4.111/btsync_freebsd_x64-1.4.111.tar.gz<br><b>32 bit: </b>http://syncapp.bittorrent.com/1.4.111/btsync_freebsd_i386-1.4.111.tar.gz<br>and hit Save URL, Fetch and Install.</font><br><br>Read more ... <a href='http://forums.nas4free.org/viewtopic.php?f=71&t=5704' target='_blank'>NAS4Free Forum</a>###rpi, rpi2, rpi3, bananapi###
|
||||
BitTorrent Sync###<font color="green">RELEASE<br>0.7.x</font>###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.<br><br>The extension is compatible with all versions (9.1.x - 11.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.<br><br>Read more ... <a href='http://forums.nas4free.org/viewtopic.php?f=71&t=5704' target='_blank'>NAS4Free Forum</a>###rpi, rpi2, rpi3, bananapi###
|
||||
Syncthing###<font color="green">RELEASE<br>0.1.5</font>###syncthing_start.php###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.<br><br>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.<br><br><font color="blue"><b>Note:</b> The current 10.3 and 10.2 series of NAS4Free contain Syncthing already out of the box so this extensions is mainly for older releases OR if one need older Syncthing versions (e.g. before 0.14.x for compatibility reasons with other devices.</font><br><br>Read more ... <a href='http://forums.nas4free.org/viewtopic.php?f=71&t=11110#p69469' target='_blank'>NAS4Free Forum</a>###-###
|
||||
TheBrig###<font color="green">RELEASE<br>0.94</font>###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.<br><br><font color="red"><b>Note:</b> After the installation navigate to rudimentary config tab and push Save to finish the installation.</font><br><br>Read more ... <a href='http://forums.nas4free.org/viewtopic.php?f=79&t=3894' target='_blank'>NAS4Free Forum</a>###-###
|
||||
DNSMasq DHCP Server###<font color="green">RELEASE<br>0.3</font>###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.<br><br><font color="red"><b>Note:</b> After the installation navigate to rudimentary config tab and push Save to finish the installation.</font><br><br>Read more ... <a href='http://forums.nas4free.org/viewtopic.php?f=71&t=3002' target='_blank'>NAS4Free Forum</a>###rpi, rpi2, rpi3, bananapi###
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
onebuttoninstaller/locale-obi/zh_CN/LC_MESSAGES/nas4free.mo
Normal file
BIN
onebuttoninstaller/locale-obi/zh_CN/LC_MESSAGES/nas4free.mo
Normal file
Binary file not shown.
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
onebuttoninstaller-install.php
|
||||
|
||||
Copyright (c) 2015 - 2016 Andreas Schmidhuber
|
||||
Copyright (c) 2015 - 2017 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -29,7 +29,7 @@
|
||||
of the authors and should not be interpreted as representing official policies,
|
||||
either expressed or implied, of the FreeBSD Project.
|
||||
*/
|
||||
$v = "v0.3.3"; // extension version
|
||||
$v = "v0.3.4"; // extension version
|
||||
$appname = "OneButtonInstaller";
|
||||
|
||||
require_once("config.inc");
|
||||
@@ -75,46 +75,64 @@ else {
|
||||
}
|
||||
|
||||
// install / update application on NAS4Free
|
||||
if ( !isset($config['onebuttoninstaller']) || !is_array($config['onebuttoninstaller'])) {
|
||||
// new installation
|
||||
$config['onebuttoninstaller'] = array();
|
||||
$config['onebuttoninstaller']['appname'] = $appname;
|
||||
$config['onebuttoninstaller']['version'] = exec("cat {$install_dir}version.txt");
|
||||
$config['onebuttoninstaller']['rootfolder'] = $install_dir;
|
||||
$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('/onebuttoninstaller/', $config['rc']['postinit']['cmd'][$i])) break; ++$i; }
|
||||
if (!isset($config['onebuttoninstaller']) || !is_array($config['onebuttoninstaller'])) $config['onebuttoninstaller'] = array();
|
||||
$config['onebuttoninstaller']['appname'] = $appname;
|
||||
$config['onebuttoninstaller']['version'] = exec("cat {$install_dir}version.txt");
|
||||
$config['onebuttoninstaller']['rootfolder'] = $install_dir;
|
||||
|
||||
// remove start/stop commands
|
||||
// remove existing old rc format entries
|
||||
if (is_array($config['rc']) && is_array($config['rc']['postinit']) && is_array( $config['rc']['postinit']['cmd'])) {
|
||||
$rc_param_count = count($config['rc']['postinit']['cmd']);
|
||||
for ($i = 0; $i < $rc_param_count; ++$i) {
|
||||
if (preg_match('/onebuttoninstaller/', $config['rc']['postinit']['cmd'][$i])) unset($config['rc']['postinit']['cmd'][$i]);
|
||||
}
|
||||
$config['rc']['postinit']['cmd'][$i] = $config['onebuttoninstaller']['rootfolder']."onebuttoninstaller_start.php";
|
||||
$i =0;
|
||||
if ( is_array($config['rc']['shutdown'] ) && is_array( $config['rc']['shutdown']['cmd'] ) ) {
|
||||
for ($i; $i < count($config['rc']['shutdown']['cmd']); ) {
|
||||
if (preg_match('/onebuttoninstaller/', $config['rc']['shutdown']['cmd'][$i])) break; ++$i; }
|
||||
}
|
||||
if (is_array($config['rc']) && is_array($config['rc']['shutdown']) && is_array( $config['rc']['shutdown']['cmd'])) {
|
||||
$rc_param_count = count($config['rc']['shutdown']['cmd']);
|
||||
for ($i = 0; $i < $rc_param_count; ++$i) {
|
||||
if (preg_match('/onebuttoninstaller/', $config['rc']['shutdown']['cmd'][$i])) unset($config['rc']['shutdown']['cmd'][$i]);
|
||||
}
|
||||
$config['rc']['shutdown']['cmd'][$i] = $config['onebuttoninstaller']['rootfolder']."onebuttoninstaller_stop.php";
|
||||
write_config();
|
||||
require_once("{$config['onebuttoninstaller']['rootfolder']}onebuttoninstaller-start.php");
|
||||
}
|
||||
// remove existing entries for new rc format
|
||||
if (is_array($config['rc']) && is_array($config['rc']['param'])) {
|
||||
$rc_param_count = count($config['rc']['param']);
|
||||
for ($i = 0; $i < $rc_param_count; $i++) {
|
||||
if (preg_match('/onebuttoninstaller/', $config['rc']['param'][$i]['value'])) unset($config['rc']['param'][$i]);
|
||||
}
|
||||
}
|
||||
|
||||
if ($release[0] >= 11.0) { // new rc format
|
||||
// postinit command
|
||||
$rc_param = [];
|
||||
$rc_param['uuid'] = uuid();
|
||||
$rc_param['name'] = "{$appname} Extension";
|
||||
$rc_param['value'] = "/usr/local/bin/php-cgi -f {$config['onebuttoninstaller']['rootfolder']}onebuttoninstaller-start.php";
|
||||
$rc_param['comment'] = "Start {$appname} Extension";
|
||||
$rc_param['typeid'] = '2';
|
||||
$rc_param['enable'] = true;
|
||||
$config['rc']['param'][] = $rc_param;
|
||||
$config['onebuttoninstaller']['rc_uuid_start'] = $rc_param['uuid'];
|
||||
|
||||
unset($rc_param);
|
||||
/* shutdown command */
|
||||
$rc_param = [];
|
||||
$rc_param['uuid'] = uuid();
|
||||
$rc_param['name'] = "{$appname} Extension";
|
||||
$rc_param['value'] = "/usr/local/bin/php-cgi -f {$config['onebuttoninstaller']['rootfolder']}onebuttoninstaller-stop.php";
|
||||
$rc_param['comment'] = "Stop {$appname} Extension";
|
||||
$rc_param['typeid'] = '3';
|
||||
$rc_param['enable'] = true;
|
||||
$config['rc']['param'][] = $rc_param;
|
||||
$config['onebuttoninstaller']['rc_uuid_stop'] = $rc_param['uuid'];
|
||||
}
|
||||
else {
|
||||
// update release
|
||||
$config['onebuttoninstaller']['version'] = exec("cat {$install_dir}version.txt");
|
||||
$config['onebuttoninstaller']['rootfolder'] = $install_dir;
|
||||
$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('/onebuttoninstaller/', $config['rc']['postinit']['cmd'][$i])) break; ++$i; }
|
||||
}
|
||||
$config['rc']['postinit']['cmd'][$i] = $config['onebuttoninstaller']['rootfolder']."onebuttoninstaller_start.php";
|
||||
$i =0;
|
||||
if ( is_array($config['rc']['shutdown'] ) && is_array( $config['rc']['shutdown']['cmd'] ) ) {
|
||||
for ($i; $i < count($config['rc']['shutdown']['cmd']); ) {
|
||||
if (preg_match('/onebuttoninstaller/', $config['rc']['shutdown']['cmd'][$i])) break; ++$i; }
|
||||
}
|
||||
$config['rc']['shutdown']['cmd'][$i] = $config['onebuttoninstaller']['rootfolder']."onebuttoninstaller_stop.php";
|
||||
write_config();
|
||||
require_once("{$config['onebuttoninstaller']['rootfolder']}onebuttoninstaller-start.php");
|
||||
$config['rc']['postinit']['cmd'][] = "/usr/local/bin/php-cgi -f {$config['onebuttoninstaller']['rootfolder']}onebuttoninstaller-start.php";
|
||||
$config['rc']['shutdown']['cmd'][] = "/usr/local/bin/php-cgi -f {$config['onebuttoninstaller']['rootfolder']}onebuttoninstaller-stop.php";
|
||||
}
|
||||
|
||||
write_config();
|
||||
require_once("{$config['onebuttoninstaller']['rootfolder']}onebuttoninstaller-start.php");
|
||||
// finally fetch the most recent extensions list to get the latest changes if not already in the master release
|
||||
$return_val = mwexec("fetch -o {$config['onebuttoninstaller']['rootfolder']}extensions.txt https://raw.github.com/crestAT/nas4free-onebuttoninstaller/master/onebuttoninstaller/extensions.txt", true);
|
||||
?>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
onebuttoninstaller-start.php
|
||||
|
||||
Copyright (c) 2015 - 2016 Andreas Schmidhuber
|
||||
Copyright (c) 2015 - 2017 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -29,6 +29,8 @@
|
||||
of the authors and should not be interpreted as representing official policies,
|
||||
either expressed or implied, of the FreeBSD Project.
|
||||
*/
|
||||
require_once("config.inc");
|
||||
|
||||
$extension_dir = "/usr/local/www";
|
||||
|
||||
mwexec("ln -sf {$config['onebuttoninstaller']['rootfolder']}locale-obi /usr/local/share/", true); // create link to languages
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
onebuttoninstaller-stop.php
|
||||
|
||||
Copyright (c) 2015 - 2016 Andreas Schmidhuber
|
||||
Copyright (c) 2015 - 2017 Andreas Schmidhuber
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -29,8 +29,12 @@
|
||||
of the authors and should not be interpreted as representing official policies,
|
||||
either expressed or implied, of the FreeBSD Project.
|
||||
*/
|
||||
require_once("config.inc");
|
||||
|
||||
$extension_dir = "/usr/local/www";
|
||||
|
||||
mwexec("rm -Rf {$extension_dir}/onebuttoninstaller*", true);
|
||||
mwexec("rm -Rf {$extension_dir}/ext/onebuttoninstaller", true);
|
||||
if (is_link("/usr/local/share/locale-obi")) unlink("/usr/local/share/locale-obi");
|
||||
exec("logger onebuttoninstaller: stopped");
|
||||
?>
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/usr/local/bin/php-cgi -f
|
||||
<?php
|
||||
require_once("config.inc");
|
||||
require_once("{$config['onebuttoninstaller']['rootfolder']}onebuttoninstaller-start.php");
|
||||
?>
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/usr/local/bin/php-cgi -f
|
||||
<?php
|
||||
require_once("config.inc");
|
||||
require_once("{$config['onebuttoninstaller']['rootfolder']}onebuttoninstaller-stop.php");
|
||||
?>
|
||||
@@ -1,4 +1,13 @@
|
||||
Version Date Description
|
||||
0.3.4 2016.11.23 N: command scripts rc format for NAS4Free 11.x compatibility
|
||||
N: MidnightCommander: command scripts rc format for NAS4Free 11.x compatibility
|
||||
N: Chinese (Simplified) translation
|
||||
C: update Dutch translation
|
||||
C: update Italian translation
|
||||
C: update Romanian translation
|
||||
C: update Spanish translation
|
||||
C: update Ukrainian translation
|
||||
C: MidnightCommander: symlinks for NAS4Free 11.x compatibility
|
||||
0.3.3 2016.09.01 N: Turkish translation
|
||||
N: Ukrainian translation
|
||||
C: update Dutch translation
|
||||
|
||||
@@ -1 +1 @@
|
||||
0.3.3
|
||||
0.3.4
|
||||
|
||||
Reference in New Issue
Block a user