diff options
author | mcrane <mctch@yahoo.com> | 2009-08-01 04:58:18 -0600 |
---|---|---|
committer | mcrane <mctch@yahoo.com> | 2009-08-01 04:58:18 -0600 |
commit | d8e5677bab893603613adefb6f839f19550a64a3 (patch) | |
tree | 7b0e9fdb3cacedd46db608b79999611dee584f02 /config | |
parent | e0660de17552d5a859b6215d1b8fa3132119bc8c (diff) | |
download | pfsense-packages-d8e5677bab893603613adefb6f839f19550a64a3.tar.gz pfsense-packages-d8e5677bab893603613adefb6f839f19550a64a3.tar.bz2 pfsense-packages-d8e5677bab893603613adefb6f839f19550a64a3.zip |
DenyHosts change startup script
Diffstat (limited to 'config')
-rw-r--r-- | config/denyhosts/denyhosts.inc | 50 | ||||
-rw-r--r-- | config/denyhosts/denyhosts.xml | 8 |
2 files changed, 32 insertions, 26 deletions
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 @@ <requirements>Describe your package requirements here</requirements> <faq>Currently there are no FAQ items provided.</faq> <name>DenyHosts</name> - <version>0.2</version> + <version>0.3</version> <title>Settings</title> <include_file>/usr/local/pkg/denyhosts.inc</include_file> <menu> @@ -51,6 +51,12 @@ <configfile>denyhosts.xml</configfile> <url>/packages/denyhosts/denyhosts_log.php</url> </menu> + <service> + <name>denyhosts</name> + <rcfile>denyhosts.sh</rcfile> + <executable>denyhosts</executable> + <description>DenyHosts analyzes logs for SSH login attempts and blocks offending IP addresses.</description> + </service> <tabs> <tab> <text>Settings</text> |