#!/bin/bash # # Startup script for NetSQUID # Default is to run as a daemon and automatically start snort # This behavior can be changed # # Default behavior for restart is a -SIGUSR1 restart, so # Blocked hosts will be reblocked. NETSQUID="/usr/local/sbin/netsquid" NETSQUID_FLAGS="-c /usr/local/etc/netsquid.config -sd" PID_FILE="/var/run/netsquid.pid" # if the executables do not exist -- display error if [ ! -f $NETSQUID ] then echo "NetSQUID file: $NETSQUID not found, perhaps you moved it?" exit 1 fi # depending on parameter -- startup, shutdown, restart # of the instance and listener or usage display case "$1" in start) # Oracle listener and instance startup echo -n "Starting NetSQUID: " $NETSQUID $NETSQUID_FLAGS ;; stop) echo -n "Shutdown NetSquid: " kill -9 `cat $PID_FILE` ;; reload) $0 stop $0 start ;; restart) kill -SIGUSR1 `cat $PID_FILE` ;; *) echo "Usage: $0 start|stop|restart|reload" echo "restart keeps blocked hosts state" echo "reload does not" exit 1 esac exit 0