Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #The goal of this script is to run the test digs on an RDNS server, and, given
- #success, reinitialize gateway services.
- #!/bin/bash
- set -o nounset
- die() {
- echo "$0" 1>&2 && exit 1;
- }
- digs= /usr/local/resolververify/testdigs.sh
- #There are a total of 18 test digs. We're hoping they all pass here.
- if [[ $(timeout 4 $digs | grep -c "NOERROR") -eq 18 ]];
- then echo "digs look good, chap. putting node back in prod";
- #This finds the statuses of our services before attempting to start them.
- $(ps aux | grep -v grep | grep -q bgpd);
- bgpd_running=$?
- $(ps aux | grep -v grep | grep -q zebra);
- zebra_running=$?
- if !$bgpd_running \
- then sudo /sbin/service bgpd start \
- $bgpd_running=$?
- else die "Something didn't work or bgpd's already running." \
- fi;
- if $bgpd_running && !$zebra_running;
- then sudo /sbin/service zebra start
- else die "Something didn't work or zebra's already running."
- fi;
- else die "didn't work, buddy"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement