parent
9eec1fe052
commit
f0c9312a89
@ -0,0 +1,26 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
||||
source $DIR/env.sh |
||||
|
||||
if [[ "$EUID" -ne 0 ]]; then |
||||
echo "Sorry, you need to run this as root" |
||||
exit 1 |
||||
fi |
||||
|
||||
TMPFILE=$(mktemp crontab.XXXXX) |
||||
crontab -l > $TMPFILE |
||||
|
||||
RESTOREPATH=$(which iptables-restore) |
||||
RESTORPRESENTS=$(grep iptables-restore $TMPFILE) |
||||
if [ $? -ne 0 ]; then |
||||
echo "@reboot $RESTOREPATH <$IPTABLES >/dev/null 2>&1" >> $TMPFILE |
||||
fi |
||||
|
||||
PPTPDPRESENTS=$(grep "$CHECKSERVER" $TMPFILE) |
||||
if [ $? -ne 0 ]; then |
||||
echo "*/5 * * * * $CHECKSERVER >/dev/null 2>&1" >> $TMPFILE |
||||
fi |
||||
|
||||
crontab $TMPFILE > /dev/null |
||||
rm $TMPFILE |
||||
@ -0,0 +1,7 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
RET=$(pgrep pptpd) |
||||
|
||||
if [ $? -eq 1 ]; then |
||||
/etc/init.d/pptpd restart |
||||
fi |
||||
Loading…
Reference in new issue