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