summaryrefslogtreecommitdiffstats
path: root/minikrebs/profiles/heckenkrebs/customfiles/usr
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2013-02-23 15:55:49 +0100
committermakefu <github@syntax-fehler.de>2013-02-23 15:55:49 +0100
commit001bfd5f2b6890cafd209de4ea360927d4dd8a55 (patch)
treeff5805c808afc2fbe460f767f65ae1152fb32776 /minikrebs/profiles/heckenkrebs/customfiles/usr
parent1ca9360f5a35d0c2ee5876bba85f2ead44e5a540 (diff)
minikrebs is now a submodule
Diffstat (limited to 'minikrebs/profiles/heckenkrebs/customfiles/usr')
m---------minikrebs0
-rwxr-xr-xminikrebs/profiles/heckenkrebs/customfiles/usr/bin/aap115
-rwxr-xr-xminikrebs/profiles/heckenkrebs/customfiles/usr/bin/easybox_keygen40
-rwxr-xr-xminikrebs/profiles/heckenkrebs/customfiles/usr/bin/infest4
-rwxr-xr-xminikrebs/profiles/heckenkrebs/customfiles/usr/bin/ledoff2
-rwxr-xr-xminikrebs/profiles/heckenkrebs/customfiles/usr/bin/tinc-update4
6 files changed, 0 insertions, 165 deletions
diff --git a/minikrebs b/minikrebs
new file mode 160000
+Subproject 8fd46a7e3258bff753c42dc43fecfbbc853a685
diff --git a/minikrebs/profiles/heckenkrebs/customfiles/usr/bin/aap b/minikrebs/profiles/heckenkrebs/customfiles/usr/bin/aap
deleted file mode 100755
index 75e1cbfe..00000000
--- a/minikrebs/profiles/heckenkrebs/customfiles/usr/bin/aap
+++ /dev/null
@@ -1,115 +0,0 @@
-#!/usr/bin/awk -f
-
-BEGIN {
- chan=0;
- essid="";
- encr=0;
- psk2=0;
- psk=0;
- i=0;
- # find interface - start by finding if in sta mode
- while( "uci show wireless" | getline) {
- if(/mode=sta/) {
- split($0,wl,".");
- iface=wl[2];
- }
- }
- close("uci show wireless")
- "uci get wireless." iface ".device" | getline radio
- close("uci get wireless." iface ".device")
- system("ifconfig wlan0 up")
- for(;;){
- while( "iwlist wlan0 scan" | getline ) {
- scan[i++]=$0;
- }
- close("iwlist wlan0 scan")
- for (j=0;j<i;j++) {
- $0=scan[j];
- if ($1 == "Cell" || $1 == EOF ) {
- if(chan == 0) continue;
- #get mac
- mac=$5
- # we're at the end of a record
- # process data we have and try to connect
- if(psk2 == 1) crypt = "psk2";
- else if (psk == 1) crypt ="psk";
- else if (encr == 1) crypt = "wep";
- else crypt = "none";
- psk=0;
- psk2=0;
- encr=0;
- rkey="";
- # first we see if we're in blacklist
- bl="0"
- "cat /etc/wifiblack | grep \"" essid "$\"" | getline bl
- close("cat /etc/wifiblack | grep \"" essid "$\"")
- if ( bl == "1" ) {
- print essid " blacklisted";
- continue;
- }
- # now we get key if we're encrypted
- if ( crypt != "none" ) {
- "cat /etc/wifipw | grep \"" essid ";\" | sed 's/[^;]*;//' " | getline rkey
- close("cat /etc/wifipw | grep \"" essid ";\" | sed 's/.*;//' ")
- if ( rkey == "" ) {
- m=match(essid,"EasyBox");
- if (RLENGTH > 0) {
- "easybox_keygen " mac | getline rkey
- close("easybox_keygen " mac)
- }
- else {
- print essid " is encrypted and key not in whitelist";
- continue;
- }
- }
- }
- system("uci set wireless." radio ".channel=" channel);
- system("uci set wireless." iface ".ssid=" essid);
- if (crypt == "none") {
- system("uci set wireless." iface ".encryption=none");
- system("uci -q delete wireless." iface ".key");
- }
- else {
- system("uci set wireless." iface ".key=" rkey);
- system("uci set wireless." iface ".encryption=" crypt);
- }
- system("uci show wireless > /tmp/keepalive");
- system("wifi up");
- while(system("sleep 60; wget -q -T 30 -O /dev/null http://google.com/index.html") == 0) {
- system("ledoff")
- }
- }
- else {
- # now test for the things we want
- # channel
- if (/Channel:[0-9]/) {
- m=match($0,"Channel");
- if (RSTART > 0) {
- s=substr($0,m);
- n=match(s,/[0-9]+/);
- chan=substr(s,n,RLENGTH)
- }
- continue;
- }
- # we don't need else as we break on successful find
- if (/^ *ESSID/) {
- m=match($0,"\".*\"");
- if (RSTART > 0) essid=substr($0,m+1,RLENGTH-2);
- continue;
- }
- if (/^ *Encryption key:on/) {
- encr = 1;
- continue;
- }
- if (/^ *IE: IEEE 802.11i\/WPA2/) {
- psk2=1;
- continue;
- }
- if (/^ *IE: WPA /) {
- psk=1;
- continue;
- }
- }
- }
- }
- }
diff --git a/minikrebs/profiles/heckenkrebs/customfiles/usr/bin/easybox_keygen b/minikrebs/profiles/heckenkrebs/customfiles/usr/bin/easybox_keygen
deleted file mode 100755
index e9a9beca..00000000
--- a/minikrebs/profiles/heckenkrebs/customfiles/usr/bin/easybox_keygen
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/sh
-#
-# easybox_keygen.sh (c) 2012 GPLv3
-#
-# www.wotan.cc
-#
-
-MAC=$1
-
-# Take the last 2 Bytes of the MAC-Address (0B:EC), and convert it to decimal.
-
-take5=${MAC:12}
-last4=${take5/:/}
-
-# Fill up to 4 places with zeros, if necessary:
-deci=$(printf "%04d" "0x$last4" | sed 's/.*\(....\)/\1/;s/./& /g')
-#echo M4: ${deci[@]}
-#
-# The digits M9 to M12 are just the last digits (9.-12.) of the MAC:
-hexi=$(echo ${MAC:12:5} | sed 's/://;s/./& /g')
-#echo 'M4 (Hex): ' ${hexi[@]}
-# K1 = last byte of (d0 + d1 + h2 + h3)
-# K2 = last byte of (h0 + h1 + d2 + d3)
-c1=$(printf "%d + %d + %d + %d" ${deci:0:1} ${deci:2:1} 0x${hexi:4:1} 0x${hexi:6:1})
-c2=$(printf "%d + %d + %d + %d" 0x${hexi:0:1} 0x${hexi:2:1} ${deci:4:1} ${deci:6:1})
-K1=$((($c1)%16))
-K2=$((($c2)%16))
-#printf "K1: %x\n" $K1
-#printf "K2: %x\n" $K2
-X1=$((K1^${deci:6:1}))
-X2=$((K1^${deci:4:1}))
-X3=$((K1^${deci:2:1}))
-Y1=$((K2^0x${hexi:2:1}))
-Y2=$((K2^0x${hexi:4:1}))
-Y3=$((K2^0x${hexi:6:1}))
-Z1=$((0x${hexi:4:1}^${deci:6:1}))
-Z2=$((0x${hexi:6:1}^${deci:4:1}))
-Z3=$((K1^K2))
-printf "%x%x%x%x%x%x%x%x%x\n" $X1 $Y1 $Z1 $X2 $Y2 $Z2 $X3 $Y3 $Z3 | tr a-f A-F
-
diff --git a/minikrebs/profiles/heckenkrebs/customfiles/usr/bin/infest b/minikrebs/profiles/heckenkrebs/customfiles/usr/bin/infest
deleted file mode 100755
index f1bcc594..00000000
--- a/minikrebs/profiles/heckenkrebs/customfiles/usr/bin/infest
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-printf "enter your tincname:"
-read HOSTNAME
-curl tinc.krebsco.de | HOSTN=$HOSTNAME sh
diff --git a/minikrebs/profiles/heckenkrebs/customfiles/usr/bin/ledoff b/minikrebs/profiles/heckenkrebs/customfiles/usr/bin/ledoff
deleted file mode 100755
index 0bc6ec7a..00000000
--- a/minikrebs/profiles/heckenkrebs/customfiles/usr/bin/ledoff
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-echo 0 > /sys/class/leds/tp-link\:blue\:system/brightness
diff --git a/minikrebs/profiles/heckenkrebs/customfiles/usr/bin/tinc-update b/minikrebs/profiles/heckenkrebs/customfiles/usr/bin/tinc-update
deleted file mode 100755
index 2c6ec432..00000000
--- a/minikrebs/profiles/heckenkrebs/customfiles/usr/bin/tinc-update
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-if test -e /etc/tinc/retiolum; then
- if ping -c 1 euer.krebsco.de -W 5 &>/dev/null; then (curl http://euer.krebsco.de/retiolum/supernodes.tar.gz | tar xz -C /etc/tinc/retiolum/hosts/);fi
-fi