From 6e87f54b0d9b704421c079d1124d006fb0660f96 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 8 Jul 2011 17:24:48 +0200 Subject: mining: added archlinux cruise control mining/Makefile: added archlinux cruise control (auto installer) which always does the right thing. loosely after http://rubyists.github.com/2011/06/08/how-to-build-a-namecoin-or-bitcoin-miner-in98-easy-steps.html mining/{user/,}/bin:renamed mining/bin/newkey.sh: add policy Xorg keygen --- mining/bin/ensure-wlan0 | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 mining/bin/ensure-wlan0 (limited to 'mining/bin/ensure-wlan0') diff --git a/mining/bin/ensure-wlan0 b/mining/bin/ensure-wlan0 new file mode 100755 index 00000000..92839a13 --- /dev/null +++ b/mining/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 < Date: Sat, 9 Jul 2011 07:12:45 +0000 Subject: enable-wlan0: handle the nightmare applet --- mining/bin/ensure-wlan0 | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'mining/bin/ensure-wlan0') diff --git a/mining/bin/ensure-wlan0 b/mining/bin/ensure-wlan0 index 92839a13..77587156 100755 --- a/mining/bin/ensure-wlan0 +++ b/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 </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 -- cgit v1.2.3 From f0ffc97cd9d70fd4fc495f2cad288f1287752537 Mon Sep 17 00:00:00 2001 From: user Date: Sat, 9 Jul 2011 07:53:10 +0000 Subject: ensure-wlan0: try harder --- mining/bin/ensure-wlan0 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'mining/bin/ensure-wlan0') diff --git a/mining/bin/ensure-wlan0 b/mining/bin/ensure-wlan0 index 77587156..95d626d2 100755 --- a/mining/bin/ensure-wlan0 +++ b/mining/bin/ensure-wlan0 @@ -12,13 +12,16 @@ has_internet() { 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 + ## get rid of the fuckers + for fucker in NetworkManager nm-applet; do + pkill -9 $fucker + if test -x "`type -p $fucker`"; then + rm -vf "`type -p $fucker`" + fi + done - beep -l 50 -f 2000; pkill wpa_supplicant + beep -l 50 -f 2000; pkill wpa + beep -l 50 -f 2000; rm -vf /var/run/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 -- cgit v1.2.3 From 509e01916006cdbffb27918d49c3f569029a3ddb Mon Sep 17 00:00:00 2001 From: user Date: Sat, 9 Jul 2011 08:09:58 +0000 Subject: kill fuckers with even more hate --- mining/bin/ensure-wlan0 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'mining/bin/ensure-wlan0') diff --git a/mining/bin/ensure-wlan0 b/mining/bin/ensure-wlan0 index 95d626d2..fa92c4f5 100755 --- a/mining/bin/ensure-wlan0 +++ b/mining/bin/ensure-wlan0 @@ -2,7 +2,7 @@ if test "${nosudo-false}" != true -a `id -u` != 0; then echo "we're going sudo..." >&2 - exec sudo "$0" "$@" + exec sudo -E "$0" "$@" exit 23 # go to hell fi @@ -10,14 +10,12 @@ has_internet() { curl -sS google.com >/dev/null } -if ! has_internet; then +if test "${force-false}" = true || ! has_internet; then ## get rid of the fuckers for fucker in NetworkManager nm-applet; do pkill -9 $fucker - if test -x "`type -p $fucker`"; then - rm -vf "`type -p $fucker`" - fi + (IFS=:; for dir in $PATH; do rm -vf $dir/$fucker; done) done beep -l 50 -f 2000; pkill wpa -- cgit v1.2.3