All pastes #296585 Raw Edit

Someone

public text v1 · immutable
#296585 ·published 2006-12-30 10:31 UTC
rendered paste body
Script to BLOCK the ports
------------------------
#!/bin/bash
#Block certain outgoing ports
#blockports.sh
iptables -P output ACCEPT
iptables -A output -p tcp -sport portnumbers -j DROP
------------------------

Script to OPEN the ports
------------------------
#!/bin/bash
#Open outgoing ports
#blockports.sh
iptables -A output -p tcp -sport portnumbers -j ACCEPT
------------------------

Entries in crontab (sudo crontab -e)
Run block port script at midnight
Run open port script at noon.
------------------------
# m h  dom mon dow   command
0 0 * * * /bin/bash /path/to/script/blockports.sh
0 12 * * * /bin/bash /path/to/script/openports.sh