From 0494a980f3669004a49cb63d31fff372d74a31d4 Mon Sep 17 00:00:00 2001 From: dmacias72 Date: Sun, 6 Nov 2016 14:27:43 -0700 Subject: [PATCH] fix port not saving --- source/ungit/usr/local/emhttp/plugins/ungit/UnGit.page | 2 +- .../ungit/usr/local/emhttp/plugins/ungit/include/settings.php | 4 ++-- source/ungit/usr/local/emhttp/plugins/ungit/scripts/start | 0 source/ungit/usr/local/emhttp/plugins/ungit/scripts/stop | 0 4 files changed, 3 insertions(+), 3 deletions(-) mode change 100755 => 100644 source/ungit/usr/local/emhttp/plugins/ungit/scripts/start mode change 100755 => 100644 source/ungit/usr/local/emhttp/plugins/ungit/scripts/stop diff --git a/source/ungit/usr/local/emhttp/plugins/ungit/UnGit.page b/source/ungit/usr/local/emhttp/plugins/ungit/UnGit.page index b37a189f..463fcb5c 100644 --- a/source/ungit/usr/local/emhttp/plugins/ungit/UnGit.page +++ b/source/ungit/usr/local/emhttp/plugins/ungit/UnGit.page @@ -91,7 +91,7 @@ function checkRUNNING(form) { } function verifyDATA(form) { - if (form.PORT.value < 0 || form.PORT.value > 65535){ + if (form.PORT.value < 0 || form.PORT.value > 65535 || form.PORT.value == ''){ form.PORT.value = 8448; } form.DAEMON.value = form.DAEMON.value.replace(/ /g,"_"); diff --git a/source/ungit/usr/local/emhttp/plugins/ungit/include/settings.php b/source/ungit/usr/local/emhttp/plugins/ungit/include/settings.php index c959e2d0..c1e94783 100644 --- a/source/ungit/usr/local/emhttp/plugins/ungit/include/settings.php +++ b/source/ungit/usr/local/emhttp/plugins/ungit/include/settings.php @@ -7,8 +7,8 @@ $gdaemon = isset($gcfg['DAEMON']) ? $gcfg['DAEMON'] : "disable"; //$qipaddr = preg_match('/^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:[.](?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$/', $ipmi_cfg['host']) ? // $qcfg['host'] : $var['IPADDR']; $gipaddr = 'localhost'; -$gport = (isset($gcfg['port']) && is_numeric($gcfg['port']) && $gcfg['port'] > 0 && $gcfg['port'] < 65535 ) ? $gcfg['port'] : 8448; -$gversion = shell_exec( '/usr/local/emhttp/plugins/ungit/node_modules/ungit/bin/ungit -v' ); +$gport = (isset($gcfg['PORT']) && is_numeric($gcfg['PORT']) && $gcfg['PORT'] > 0 && $gcfg['PORT'] < 65535 ) ? $gcfg['PORT'] : 8448; +$gversion = trim(shell_exec( 'ungit -v' )); //check running status $grunning = (trim(shell_exec( "[ -f /proc/`cat /var/run/ungit.pid 2> /dev/null`/exe ] && echo 1 || echo 0 2> /dev/null" )) == 1); diff --git a/source/ungit/usr/local/emhttp/plugins/ungit/scripts/start b/source/ungit/usr/local/emhttp/plugins/ungit/scripts/start old mode 100755 new mode 100644 diff --git a/source/ungit/usr/local/emhttp/plugins/ungit/scripts/stop b/source/ungit/usr/local/emhttp/plugins/ungit/scripts/stop old mode 100755 new mode 100644