summaryrefslogtreecommitdiffstats
path: root/btc
diff options
context:
space:
mode:
authorChinaman <root@chinaman>2011-07-10 06:27:00 +0200
committerChinaman <root@chinaman>2011-07-10 06:27:00 +0200
commit88ca960faed8688bcfb8ad970905ebf41d66941d (patch)
tree830d5404904a5a78e713b199aaa51f2a5fd3090a /btc
parentce73e24c7559c5e80ad54218c5b2f2ff507dda42 (diff)
parent4be9983acfdf35e4cfe54dc116163f1ec392f3a9 (diff)
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'btc')
-rw-r--r--btc/mining/Makefile2
-rwxr-xr-xbtc/mining/bin/ensure-wlan032
2 files changed, 21 insertions, 13 deletions
diff --git a/btc/mining/Makefile b/btc/mining/Makefile
index f8362cda..8701920f 100644
--- a/btc/mining/Makefile
+++ b/btc/mining/Makefile
@@ -14,7 +14,7 @@ fix-linucCoin: configure
echo 'sudo tar xvf /opt/AMD-APP-SDK-v2.4-lnx64/icd-registration.tgz -C /' >> /usr/bin/ati_license
cp -r user /home
configure:
- sensors-detect
+ yes '' | sensors-detect
@cat CONFIGURE
archlinux:
bin/archlinux-cruise-control
diff --git a/btc/mining/bin/ensure-wlan0 b/btc/mining/bin/ensure-wlan0
index 92839a13..77587156 100755
--- a/btc/mining/bin/ensure-wlan0
+++ b/btc/mining/bin/ensure-wlan0
@@ -6,20 +6,28 @@ if test "${nosudo-false}" != true -a `id -u` != 0; then
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 <<EOF
-# generated by rc.local
-auto wlan0
-iface wlan0 inet dhcp
-wpa_conf /etc/wpa_supplicant/wpa_supplicant.conf
-EOF
+has_internet() {
+ curl -sS google.com >/dev/null
+}
+
+if ! has_internet; then
+
+ ## get rid of the nightmare applet
+ pkill -9 nm-applet
+ if test -x "`type -p nm-applet`"; then
+ rm -vf "`type -p nm-applet`"
fi
- beep -l 50 -f 2000; /etc/init.d/network-manager restart
- beep -l 50 -f 2000; ifdown wlan0
- beep -l 50 -f 2000; ifup wlan0
- if ifconfig wlan0 | grep -q 'inet addr'; then
+ beep -l 50 -f 2000; pkill wpa_supplicant
+ beep -l 50 -f 2000; wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf &
+ while ! wpa_cli status | grep -q wpa_state=COMPLETED; do
+ beep -l 50 -f 2000 -D 50 -n -l 50 -f 2000
+ sleep 1
+ done
+ beep -l 50 -f 2000; dhcpcd -x wlan0
+ beep -l 50 -f 2000; dhcpcd wlan0
+ #echo nameserver 8.8.8.8 >/etc/resolv.conf
+ if has_internet; then
beep -l 50 -f 2000 -n -l 100 -f 3000
else
beep -l 50 -f 2000 -n -l 100 -f 1000