Custom script on pfsense 2.0.2
-
Hello World,
Please I want to know how to execute a custom script on pfsense.
I've found the following procedure:
http://forum.pfsense.org/index.php/topic,7228.0.html
and i would to know if It is right.
If no, how i can configure the script.
Please, if you can check my script, It bring down one network adapter of a particular host cannot answer to a ping.#!/usr/local/etc/rc.d timeout=5 # delay between checks pingip='10.155.0.3' # what to ping iface="em3" LOG_FILE="/var/log/" isdown=0 # indicate whether the interface is up or down # start assuming interface is up while true; do LOG_TIME=`date +%b' '%d' '%T` if ping -q -c 2 "$pingip" >> /dev/null ; then # ping is good - bring iface up if [ "$isdown" -ne 0 ] ; then ifup $iface && isdown=0 printf "$LOG_TIME $0: Interface brought up: %s\n" "$iface" | tee -a $LOG_FILE fi else # ping is bad - bring iface down beep -f 4000 if [ "$isdown" -ne 1 ] ; then ifdown $iface && isdown=1 printf "$LOG_TIME $0: Interface brought down: %s\n" "$iface" | tee -a $LOG_FILE fi fi sleep "$timeout" done
BEst regards.
Matteo