Skip to content

Instantly share code, notes, and snippets.

View tolitski's full-sized avatar

tolitski tolitski

View GitHub Profile
@tolitski
tolitski / firewall
Last active September 19, 2016 17:48
Firewall to be stored in /etc/init.d as filename firewall
#! /bin/sh
### BEGIN INIT INFO
# Provides: iptables
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Should-Start: $network $syslog
# Should-Stop: $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Firewall script
@tolitski
tolitski / allstar_watchdog.sh
Last active July 13, 2016 23:11
This is a short script to monitor an allstar node and will restart if for some reason asterisk crashes.
#!/bin/bash -x
# Thanks for justin campbell for his original code.
DIR=/tmp/watchdog
#replace this with your node number
NODE=41787
# Create dir if it doesn't exist
if [ ! -d $DIR ]; then