From c163035fa430a0f2322219eb7aa6fa0b86992c4f 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 --- btc/mining/user/bin/ensure-wlan0 | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 btc/mining/user/bin/ensure-wlan0 (limited to 'btc/mining/user') diff --git a/btc/mining/user/bin/ensure-wlan0 b/btc/mining/user/bin/ensure-wlan0 new file mode 100755 index 00000000..92839a13 --- /dev/null +++ b/btc/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 <