From d8e5677bab893603613adefb6f839f19550a64a3 Mon Sep 17 00:00:00 2001 From: mcrane Date: Sat, 1 Aug 2009 04:58:18 -0600 Subject: DenyHosts change startup script --- config/denyhosts/denyhosts.inc | 50 +++++++++++++++++++++--------------------- config/denyhosts/denyhosts.xml | 8 ++++++- 2 files changed, 32 insertions(+), 26 deletions(-) (limited to 'config/denyhosts') diff --git a/config/denyhosts/denyhosts.inc b/config/denyhosts/denyhosts.inc index 1efb250a..4d4188b2 100644 --- a/config/denyhosts/denyhosts.inc +++ b/config/denyhosts/denyhosts.inc @@ -99,24 +99,25 @@ function php_install_command() unlink_if_exists("/tmp/denyhosts_log.tmp"); - $denyhosts_sh = "\n"; - $denyhosts_sh .= "name=\"denyhosts\"\n"; - $denyhosts_sh .= "rcvar=\${name}_enable\n"; - $denyhosts_sh .= "\n"; - $denyhosts_sh .= "command=\"/usr/local/bin/denyhosts.py\"\n"; - $denyhosts_sh .= "command_interpreter=\"/usr/local/bin/python2.5\"\n"; - $denyhosts_sh .= "command_args=\"--config /usr/local/etc/denyhosts.conf --daemon\"\n"; - $denyhosts_sh .= "pidfile=\"/var/run/\${name}.pid\"\n"; - $denyhosts_sh .= "\n"; - $denyhosts_sh .= "load_rc_config \$name\n"; - $denyhosts_sh .= "\n"; - $denyhosts_sh .= ": \${denyhosts_enable=\"YES\"}\n"; - $denyhosts_sh .= "\n"; - $denyhosts_sh .= "run_rc_command \"\$1\"\n"; - $fout = fopen("/usr/local/etc/rc.d/denyhosts.sh","w"); - fwrite($fout, $denyhosts_sh); - unset($denyhosts_sh); - fclose($fout); + //$denyhosts_sh = "\n"; + //$denyhosts_sh .= "name=\"denyhosts\"\n"; + //$denyhosts_sh .= "rcvar=\${name}_enable\n"; + //$denyhosts_sh .= "\n"; + //$denyhosts_sh .= "command=\"/usr/local/bin/denyhosts.py\"\n"; + //$denyhosts_sh .= "command_interpreter=\"/usr/local/bin/python2.5\"\n"; + //$denyhosts_sh .= "command_args=\"--config /usr/local/etc/denyhosts.conf --daemon\"\n"; + //$denyhosts_sh .= "pidfile=\"/var/run/\${name}.pid\"\n"; + //$denyhosts_sh .= "\n"; + //$denyhosts_sh .= "load_rc_config \$name\n"; + //$denyhosts_sh .= "\n"; + //$denyhosts_sh .= ": \${denyhosts_enable=\"YES\"}\n"; + //$denyhosts_sh .= "\n"; + //$denyhosts_sh .= "run_rc_command \"\$1\"\n"; + //$fout = fopen("/usr/local/etc/rc.d/denyhosts.sh","w"); + //fwrite($fout, $denyhosts_sh); + //unset($denyhosts_sh); + //fclose($fout); + //exec("chmod 755 /usr/local/etc/rc.d/denyhosts.sh"); $filename = "/usr/local/etc/denyhosts.conf"; @@ -140,13 +141,12 @@ function php_install_command() fclose($fout); - //Error reading file: denyhosts.cfg - //write_rcfile(array( - // "file" => "denyhosts.sh", - // "start" => "start command", - // "stop" => "rm /var/run/nameofservice.pid" - // ) - //); + write_rcfile(array( + "file" => "denyhosts.sh", + "start" => "/usr/local/bin/python2.5 /usr/local/bin/denyhosts.py --config /usr/local/etc/denyhosts.conf --daemon", + "stop" => "rm /var/run/denyhosts.pid" + ) + ); php_sync_package(); diff --git a/config/denyhosts/denyhosts.xml b/config/denyhosts/denyhosts.xml index 5a09be94..72a239c5 100644 --- a/config/denyhosts/denyhosts.xml +++ b/config/denyhosts/denyhosts.xml @@ -41,7 +41,7 @@ Describe your package requirements here Currently there are no FAQ items provided. DenyHosts - 0.2 + 0.3 Settings /usr/local/pkg/denyhosts.inc @@ -51,6 +51,12 @@ denyhosts.xml /packages/denyhosts/denyhosts_log.php + + denyhosts + denyhosts.sh + denyhosts + DenyHosts analyzes logs for SSH login attempts and blocks offending IP addresses. + Settings -- cgit v1.2.3