diff options
author | dougb <dougb@FreeBSD.org> | 2003-02-13 19:20:38 +0800 |
---|---|---|
committer | dougb <dougb@FreeBSD.org> | 2003-02-13 19:20:38 +0800 |
commit | 966e32f767dead4d2be5a45f2bfdfb7f74c9b161 (patch) | |
tree | 437218fb7b43c415f993652ebdb3cc5754758cab /net/hawk/files | |
parent | 4b94c1697e0c16eca1947ca81f803bb28db58b31 (diff) | |
download | freebsd-ports-gnome-966e32f767dead4d2be5a45f2bfdfb7f74c9b161.tar.gz freebsd-ports-gnome-966e32f767dead4d2be5a45f2bfdfb7f74c9b161.tar.zst freebsd-ports-gnome-966e32f767dead4d2be5a45f2bfdfb7f74c9b161.zip |
New port of a nifty utilty that uses perl to ping the networks you
specify, mysql to save the data, and php to display it. Fairly
configurable, and easy to set up.
Diffstat (limited to 'net/hawk/files')
-rw-r--r-- | net/hawk/files/create_hawk_db.sql | 13 | ||||
-rw-r--r-- | net/hawk/files/create_hawk_user.sql | 8 | ||||
-rw-r--r-- | net/hawk/files/hawk.sh | 34 |
3 files changed, 55 insertions, 0 deletions
diff --git a/net/hawk/files/create_hawk_db.sql b/net/hawk/files/create_hawk_db.sql new file mode 100644 index 000000000000..6d4aefe1d6fa --- /dev/null +++ b/net/hawk/files/create_hawk_db.sql @@ -0,0 +1,13 @@ +# Feed this file to mysql, e.g., +# mysql -v < create_hawk_db.sql + +create database hawk; +use hawk; +create table ip ( + ip char(16) NOT NULL default '0', + hostname char(255) default NULL, + lastping int(10) default NULL, + primary key (ip), + unique key ip (ip), + key ip_2 (ip) +) type=MyISAM comment='Table for last ping time of hosts'; diff --git a/net/hawk/files/create_hawk_user.sql b/net/hawk/files/create_hawk_user.sql new file mode 100644 index 000000000000..594447c48a19 --- /dev/null +++ b/net/hawk/files/create_hawk_user.sql @@ -0,0 +1,8 @@ +# Feed this file to mysql, e.g., +# mysql -v < create_hawk_user.sql + +grant select,insert,update,delete + on hawk.* + to hawk@localhost + identified by 'YOUR_PASSWORD_HERE'; +flush privileges; diff --git a/net/hawk/files/hawk.sh b/net/hawk/files/hawk.sh new file mode 100644 index 000000000000..4285b3448c6e --- /dev/null +++ b/net/hawk/files/hawk.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +PATH=/bin:/usr/bin +export PATH + +stop_hawk () { + if [ -f /var/run/hawk.pid ];then + kill `cat /var/run/hawk.pid` + else + ps -ax | awk '/[h]awk$/ {print $1}' | xargs kill + fi +} + +case "${1}" in +start) + echo 'Starting hawk' + %%PREFIX%%/sbin/hawk & + ;; +stop) + echo 'Stopping hawk' + stop_hawk + ;; +restart) + echo 'Restarting hawk' + stop_hawk + %%PREFIX%%/sbin/hawk & + ;; +*) + echo "Usage: $0 {start|stop|restart}" + exit 1 + ;; +esac + +exit 0 |