From 52237fa9912ac06ce89a1e61f8fde4d1a44cf828 Mon Sep 17 00:00:00 2001 From: user Date: Sun, 3 Jul 2011 06:37:25 +0000 Subject: add mining/user/bin/ensure-wlan0 usage: combine this with cron to ensure wlan0 --- mining/user/bin/ensure-wlan0 | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 mining/user/bin/ensure-wlan0 (limited to 'mining') diff --git a/mining/user/bin/ensure-wlan0 b/mining/user/bin/ensure-wlan0 new file mode 100755 index 00000000..92839a13 --- /dev/null +++ b/mining/user/bin/ensure-wlan0 @@ -0,0 +1,32 @@ +#! /bin/sh + +if test "${nosudo-false}" != true -a `id -u` != 0; then + echo "we're going sudo..." >&2 + exec sudo "$0" "$@" + exit 23 # go to hell +fi + +if ! ifconfig wlan0 | grep -q 'inet addr'; then + if ! grep -q wlan0 /etc/network/interfaces; then + cat >> /etc/network/interfaces <