diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2015-09-18 14:17:05 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2015-09-18 14:17:05 -0300 |
commit | d09f347afc0a99481673f227f83864d06206add6 (patch) | |
tree | 867eba743474f4d460ade4f2b5e04903f6e4ad17 /files/bin | |
parent | 94529422ec6736f9beaa1dc44540645b28925101 (diff) | |
download | puppet-nodo-d09f347afc0a99481673f227f83864d06206add6.tar.gz puppet-nodo-d09f347afc0a99481673f227f83864d06206add6.tar.bz2 |
Adds nodo::subsystem::monitor::interface
Diffstat (limited to 'files/bin')
-rwxr-xr-x | files/bin/ifcheck | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/files/bin/ifcheck b/files/bin/ifcheck new file mode 100755 index 0000000..c66f2ad --- /dev/null +++ b/files/bin/ifcheck @@ -0,0 +1,19 @@ +#!/bin/bash +# +# Check if a network interface is up, fixing if needed. +# + +# Parameters +BASENAME="`basename $0`" +IFACE="$1" + +# Syntax check +if [ -z "$IFACE" ]; then + echo "usage: $BASENAME <interface>" + exit 1 +fi + +# Run +if ! LANG=C LC_ALL=C ifconfig $IFACE | grep -q "inet addr:"; then + ifup --force $IFACE +fi |