From 5af9be070cb8c00c61cf54372ecec3e1312c7e8f 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 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 <