From 357b5bd950732a1bb37cdaf1954cdfef43fe738c Mon Sep 17 00:00:00 2001 From: Matias Barcenas Date: Tue, 8 Aug 2017 15:06:47 -0500 Subject: [PATCH] Deleted obsolete files and directories. --- lib/airmon/airmon.sh | 1329 ------------------------------------------ lib/exitmode.sh | 99 ---- siteinstaller.py | 307 ---------- sites | 1 - 4 files changed, 1736 deletions(-) delete mode 100755 lib/airmon/airmon.sh delete mode 100644 lib/exitmode.sh delete mode 100755 siteinstaller.py delete mode 160000 sites diff --git a/lib/airmon/airmon.sh b/lib/airmon/airmon.sh deleted file mode 100755 index 861f9bd..0000000 --- a/lib/airmon/airmon.sh +++ /dev/null @@ -1,1329 +0,0 @@ -#!/bin/sh - -USERID="" -IFACE="" -KISMET=/etc/kismet/kismet.conf -CH=$3; [ x$3 = "x" ] && CH=10 -IFACE_FOUND="false" -MADWIFI=0 -MAC80211=0 -USE_IW=0 -IW_SOURCE="https://www.kernel.org/pub/software/network/iw/iw-3.17.tar.xz" -IW_ERROR="" -UDEV_ISSUE=0 - -if [ -f "`which iw 2>&1`" ] -then - USE_IW=1 -fi - -if [ "x$MON_PREFIX" = "x" ] -then -MON_PREFIX="mon" -fi - -PROCESSES="wpa_action\|wpa_supplicant\|wpa_cli\|dhclient\|ifplugd\|dhcdbd\|dhcpcd\|NetworkManager\|knetworkmanager\|avahi-autoipd\|avahi-daemon\|wlassistant\|wifibox" -PS_ERROR="invalid" - -usage() { - printf "usage: `basename $0` [channel or frequency]\n" - echo - exit -} - -startStdIface() { - iwconfig $1 mode monitor >/dev/null 2>&1 - if [ ! -z $2 ] - then - if [ $2 -lt 1000 ] - then - iwconfig $1 channel $2 >/dev/null 2>&1 - else - iwconfig $1 freq "$2"000000 > /dev/null 2>&1 - fi - fi - iwconfig $1 key off >/dev/null 2>&1 - ifconfig $1 up - printf " (monitor mode enabled)" -} - - -stopStdIface() { - ifconfig $1 down >/dev/null 2>&1 - iwconfig $1 mode Managed >/dev/null 2>&1 - ifconfig $1 down >/dev/null 2>&1 - printf " (monitor mode disabled)" -} - -getModule() { - if [ -f "/sys/class/net/$1/device/driver/module/srcversion" ] - then - srcver1=`cat "/sys/class/net/$1/device/driver/module/srcversion"` - for j in `lsmod | awk '{print $1}' | grep -v "^Module$"` - do - srcver2="`modinfo $j 2>/dev/null | grep srcversion | awk '{print $2}'`" - if [ $srcver1 = "$srcver2" ] - then - MODULE=$j - break - fi - done - else - MODULE="" - fi -# return 0 -} - -getDriver() { - if [ -e "/sys/class/net/$1/device/driver" ] - then - DRIVER="`ls -l "/sys/class/net/$1/device/driver" | sed 's/^.*\/\([a-zA-Z0-9_-]*\)$/\1/'`" - BUS="`ls -l "/sys/class/net/$1/device/driver" | sed 's/^.*\/\([a-zA-Z0-9_-]*\)\/.*\/.*$/\1/'`" - else - DRIVER="" - BUS="" - fi - if [ x$(echo $DRIVER | grep ath5k) != "x" ] - then - DRIVER="ath5k" - fi - if [ x$(echo $DRIVER | grep ath9k) != "x" ] - then - DRIVER="ath9k" - fi - if [ x$DRIVER = "x" ] - then - if [ -d /sys/class/net/tiwlan0/wireless ] - then - DRIVER=WiLink - fi - fi - -} - -scanProcesses() { - if [ -f "`which service 2>&1`" ] && [ x"$1" = "xkill" ] - then - service network-manager stop 2>/dev/null >/dev/null - service avahi-daemon stop 2>/dev/null >/dev/null - fi - - match=`ps -A -o comm= | grep $PROCESSES | grep -v grep | wc -l` - if [ $match -gt 0 -a x"$1" != "xkill" ] - then - printf "\n\n" - echo "Found $match processes that could cause trouble." - echo "If airodump-ng, aireplay-ng or airtun-ng stops working after" - echo "a short period of time, you may want to kill (some of) them!" - echo -e "\nPID\tName" - else - if [ x"$1" != "xkill" ] - then - return - fi - fi - - if [ $match -gt 0 -a x"$1" = "xkill" ] - then - echo "Killing all those processes..." - fi - - i=1 - while [ $i -le $match ] - do - pid=`ps -A -o pid= -o comm= | grep $PROCESSES | grep -v grep | head -n $i | tail -n 1 | awk '{print $1}'` - pname=`ps -A -o pid= -o comm= | grep $PROCESSES | grep -v grep | head -n $i | tail -n 1 | awk '{print $2}'` - if [ x"$1" != "xkill" ] - then - printf "$pid\t$pname\n" - else - kill $pid - fi - i=$(($i+1)) - done -} - -checkProcessesIface() { - if [ x"$1" = "x" ] - then - return - fi - - match2=`ps -o comm= -p 1 2>&1 | grep $PS_ERROR | grep -v grep | wc -l` - if [ $match2 -gt 0 ] - then - return - fi - - for i in `ps auxw | grep $1 | grep -v "grep" | grep -v "airmon" | awk '{print $2}'` - do - pname=`ps -o comm= -p $i` - echo "Process with PID $i ($pname) is running on interface $1" - done -} - -getStack() { - if [ x"$1" = "x" ] - then - return - fi - - if [ -d /sys/class/net/$1/phy80211/ ] - then - MAC80211=1 - else - MAC80211=0 - fi -} - -#you need to run getDriver $iface prior to getChipset -getChipset() { - if [ x"$1" = "x" ] - then - return - fi - - CHIPSET="Unknown " - - if [ x$DRIVER = "xOtus" -o x$DRIVER = "xarusb_lnx" ] - then - CHIPSET="AR9001U" - fi - - if [ x$DRIVER = "xWiLink" ] - then - CHIPSET=`dmesg | grep TIWLAN | grep CHIP | tail -n 1 | awk -F\ '{ print $6 }'` - if [ x$CHIPSET = "x" ] - then - CHIPSET="Unknown" - else - CHIPSET="TI${CHIPSET}" - fi - fi - - if [ x$DRIVER = "xar9170usb" ] - then - getPhy $2 - CHIPSET="Atheros `dmesg | grep $PHYDEV | grep "is registered as" | cut -d':' -f 2 | cut -d' ' -f 3`" - fi - - if [ x$DRIVER = "xzd1211rw_mac80211" ] - then - CHIPSET="ZyDAS 1211" - fi - - if [ x$DRIVER = "xzd1211rw" ] - then - getPhy $2 - TEMP_USBPORT="`dmesg | grep $PHYDEV | grep zd1211rw | cut -d'w' -f 2 | cut -d' ' -f 2`" - TEMP_CHIPSET="`dmesg | grep "$TEMP_USBPORT" | grep chip | tail -n 1 | cut -d':' -f 3 | cut -d' ' -f 2`" - CHIPSET="Zydas $TEMP_CHIPSET" - fi - - if [ x$DRIVER = "xacx" -o x$DRIVER = "xacx-mac80211" -o x$DRIVER = "xacx1xx" ] - then - CHIPSET="TI ACX1xx" - fi - - if [ x$DRIVER = "adm8211" ] - then - CHIPSET="ADMtek 8211" - fi - - if [ x$DRIVER = "xat76_usb" ] - then - CHIPSET="Atmel " - fi - - if [ x$DRIVER = "xb43" -o x$DRIVER = "xb43legacy" -o x$DRIVER = "xbcm43xx" -o x$DRIVER = "xwl" ] - then - CHIPSET="Broadcom" - if [ x$DRIVER = "xb43" ] - then - getPhy $2 - TEMP_CHIPSET="`dmesg | grep $PHYDEV | grep found | cut -d':' -f 2 | cut -d' ' -f 3`" - if [ x$TEMP_CHIPSET = "x4318" ] - then - CHIPSET="$CHIPSET $TEMP_CHIPSET" - fi - fi - fi - - if [ x$DRIVER = "xprism54" -o x$DRIVER = "xp54pci" -o x$DRIVER = "xp54usb" ] - then - CHIPSET="PrismGT " - fi - - if [ x$DRIVER = "xhostap" ] - then - CHIPSET="Prism 2/2.5/3" - fi - - if [ x$DRIVER = "xr8180" -o x$DRIVER = "xrtl8180" ] - then - CHIPSET="RTL8180/RTL8185" - fi - - # r8187 is reporting itself as rtl8187 - if [ x$DRIVER = "xrtl8187" ] - then - getPhy $2 - if [ x"$PHYDEV" = "x" ] - then - CHIPSET="RTL8187 " - else - CHIPSET="`dmesg | grep $PHYDEV | grep hwaddr | cut -d',' -f 2 | cut -d' ' -f 2`" - if [ x$CHIPSET = "xRTL8187vB" ] - then - CHIPSET="Realtek RTL8187L" - else - CHIPSET="Realtek $CHIPSET" - fi - fi - fi - - if [ x$DRIVER = "xr8187" ] - then - CHIPSET="RTL8187 " - fi - - if [ x$DRIVER = "xrt2570" -o x$DRIVER = "xrt2500usb" ] - then - CHIPSET="Ralink 2570 USB" - fi - - if [ x$DRIVER = "xrt2400" -o x$DRIVER = "xrt2400pci" ] - then - CHIPSET="Ralink 2400 PCI" - fi - - if [ x$DRIVER = "xrt2500" -o x$DRIVER = "xrt2500pci" ] - then - CHIPSET="Ralink 2560 PCI" - fi - - if [ x$DRIVER = "xrt61" -o x$DRIVER = "xrt61pci" ] - then - CHIPSET="Ralink 2561 PCI" - fi - - if [ x$DRIVER = "xrt73" -o x$DRIVER = "xrt73usb" ] - then - CHIPSET="Ralink 2573 USB" - fi - - #if [ x$DRIVER = "xrt2800usb" ] - #then - # getPhy $2 - # CHIPSET="Ralink `dmesg | grep rt2800usb | grep firmware | cut -d':' -f 4 | cut -d' ' -f 3 | cut -d'.' -f 1`" - #fi - - if [ x$DRIVER = "xrt2800" -o x$DRIVER = "xrt2800usb" -o x$DRIVER = "xrt3070sta" ] - then - CHIPSET="Ralink RT2870/3070" - fi - - if [ x$DRIVER = "xipw2100" ] - then - CHIPSET="Intel 2100B" - fi - - if [ x$DRIVER = "xipw2200" ] - then - CHIPSET="Intel 2200BG/2915ABG" - fi - - if [ x$DRIVER = "xipw3945" -o x$DRIVER = "xipwraw" -o x$DRIVER = "xiwl3945" ] - then - CHIPSET="Intel 3945ABG" - fi - - if [ x$DRIVER = "xipw4965" -o x$DRIVER = "xiwl4965" ] - then - CHIPSET="Intel 4965AGN" - fi - - if [ x$DRIVER = "xiwlagn" -o x$DRIVER = "xiwlwifi" ] - then - CHIPSET="Intel 4965/5xxx/6xxx/1xxx" - - DETECTED_STR="`dmesg | grep $DRIVER | grep Detected | tail -n 1 `" - LINK_POS="3" - FOUND="0" - - if [ x"$DETECTED_STR" != "x" ] - then - INTEL_WORD="Link" - if [ "`echo "$DETECTED_STR" | grep $INTEL_WORD | wc -l`" = "0" ] - then - INTEL_WORD="Wireless" - if [ "`echo "$DETECTED_STR" | grep $INTEL_WORD | wc -l`" = "0" ] - then - INTEL_WORD="Ultimate" - if [ "`echo "$DETECTED_STR" | grep $INTEL_WORD | wc -l`" = "0" ] - then - INTEL_WORD="Advanced" - fi - fi - fi - - while [ $FOUND = "0" ] - do - FOUND=`echo "$DETECTED_STR" | cut -d' ' -f $LINK_POS | grep $INTEL_WORD | wc -l` - LINK_POS=$(($LINK_POS+1)) - done - - TEMP_CHIPSET=`echo "$DETECTED_STR" | cut -d' ' -f $LINK_POS` - - case "x${TEMP_CHIPSET}" in - # x5100AGN) - # CHIPSET="Intel $TEMP_CHIPSET" - # ;; - x5300) - TYPE_TEMP=`echo "$DETECTED_STR" | cut -d' ' -f $(($LINK_POS+1)) | awk -F, '{ print $1 }' ` - CHIPSET="Intel ${TEMP_CHIPSET}${TYPE_TEMP}" - ;; - x1000) - TYPE_TEMP=`echo "$DETECTED_STR" | cut -d' ' -f $[$LINK_POS+2]` - CHIPSET="Intel ${TEMP_CHIPSET}${TYPE_TEMP}" - ;; - *) - CHIPSET="Intel $TEMP_CHIPSET" - ;; - esac - fi - - fi - - if [ x$DRIVER = "xath5k" ] - then - getPhy $2 - CHIPSET="Atheros `dmesg | grep $PHYDEV | grep "chip found" | cut -d':' -f 2 | cut -d' ' -f 3`" - fi - - if [ x$DRIVER = "xath_pci" ] - then - CHIPSET="Atheros " - fi - - if [ x$DRIVER = "xath9k" ] - then - getPhy $2 - CHIPSET="Atheros `dmesg | grep $PHYDEV | grep Atheros | tail -n 1 | cut -d':' -f 2 | cut -d' ' -f 3`" - fi - - if [ x$DRIVER = "xorinoco" ] - then - CHIPSET="Hermes/Prism" - fi - - if [ x$DRIVER = "xath9k_htc" -o x$DRIVER = "xusb" ] - then - CHIPSET="AR9001/9002/9271" - fi - - if [ x$DRIVER = "xwl12xx" ] - then - CHIPSET="TI WL1251/WL1271" - IS_WL1251="`dmesg| grep firmware | grep wl1251 | wc -l`" - IS_WL1271="`dmesg| grep firmware | grep wl1271 | wc -l`" - - if [ $IS_WL1251 != "0" ] && [ $IS_WL1271 = "0" ] - then - CHIPSET="TI WL1251" - fi - if [ $IS_WL1271 != "0" ] && [ $IS_WL1251 = "0" ] - then - CHIPSET="TI WL1271" - fi - # In any other case, we can't determine the chipset and thus give the generic: 1251/1271 - fi - - - if [ x$DRIVER = "xr871x_usb_drv" ] - then - CHIPSET="Realtek 81XX" - fi - - if [ x$DRIVER = "xcarl9170" ] - then - getPhy $2 - CHIPSET=`dmesg | grep usb | grep $PHYDEV | awk -F\ '{ print $3 " " $4 }'` - if [ `echo $CHIPSET | grep -i atheros | wc -l` -eq 0 ] - then - CHIPSET=`dmesg | grep usb | grep $PHYDEV | awk -F\ '{ print $5 " " $6 }'` - fi - fi -} - -getPhy() { - PHYDEV="" - if [ x"$1" = "x" ] - then - return - fi - - if [ x$MAC80211 = "x" ] - then - return - fi - - if [ -d /sys/class/net/$1/phy80211/ ] - then - PHYDEV="`ls -l "/sys/class/net/$1/phy80211" | sed 's/^.*\/\([a-zA-Z0-9_-]*\)$/\1/'`" - fi -} - -getNewMon() { - i=0 - - while [ -d /sys/class/net/$MON_PREFIX$i/ ] - do - i=$(($i+1)) - done - - MONDEV="$MON_PREFIX$i" -} - -if [ x"`which id 2> /dev/null`" != "x" ] -then - USERID="`id -u 2> /dev/null`" -fi - -if [ x$USERID = "x" -a x$UID != "x" ] -then - USERID=$UID -fi - -if [ x$USERID != "x" -a x$USERID != "x0" ] -then - echo Run it as root ; exit ; -fi - -iwpriv > /dev/null 2> /dev/null || - { echo Wireless tools not found ; exit ; } - -if [ x"$1" = "xcheck" ] || [ x"$1" = "xstart" ] -then - scanProcesses - for iface in `iwconfig 2>/dev/null | egrep '(IEEE|ESSID|802\.11|WLAN)' | sed 's/^\([a-zA-Z0-9_.]*\) .*/\1/' | grep -v wifi` - do -# getModule $iface -# getDriver $iface - checkProcessesIface $iface - done - - if [ x"$2" = "xkill" ] - then - scanProcesses "$2" - fi - if [ x"$1" = "xcheck" ] - then - exit - fi -fi - -printf "\n\n" - -if [ $# -ne "0" ] -then - if [ x$1 != "xstart" ] && [ x$1 != "xstop" ] - then - usage - fi - - if [ x$2 = "x" ] - then - usage - fi -fi - -SYSFS=0 -if [ -d /sys/ ] -then - SYSFS=1 -fi - -printf "Interface\tChipset\t\tDriver\n\n" - - -for iface in `ifconfig -a 2>/dev/null | egrep UNSPEC | sed 's/^\([a-zA-Z0-9_]*\) .*/\1/'` -do - - if [ x"`iwpriv $iface 2>/dev/null | grep ipwraw-ng`" != "x" ] - then - printf "$iface\t\tIntel 3945ABG\tipwraw-ng" - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - cp $KISMET~ $KISMET 2>/dev/null && - echo "source=ipw3945,$iface,Centrino_abg" >>$KISMET - startStdIface $iface $CH - iwconfig $iface rate 1M 2> /dev/null >/dev/null - iwconfig $iface txpower 16 2> /dev/null >/dev/null - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - stopStdIface $iface - iwconfig $iface txpower 15 2> /dev/null >/dev/null - iwconfig $iface rate 54M 2> /dev/null >/dev/null - fi - echo - continue - fi - - if [ -e "/proc/sys/dev/$iface/fftxqmin" ] - then - MADWIFI=1 - ifconfig $iface up - printf "$iface\t\tAtheros\t\tmadwifi-ng" - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - IFACE=`wlanconfig ath create wlandev $iface wlanmode monitor -bssid | grep ath` - cp $KISMET~ $KISMET 2>/dev/null && - echo "source=madwifi_g,$iface,Atheros" >>$KISMET - ifconfig $iface up 2>/dev/null >/dev/null - if [ $CH -lt 1000 ] - then - iwconfig $IFACE channel $CH 2>/dev/null >/dev/null - else - iwconfig $IFACE freq "$CH"000000 2>/dev/null >/dev/null - fi - ifconfig $IFACE up 2>/dev/null >/dev/null - UDEV_ISSUE=$? - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - echo "$iface does not support 'stop', do it on ath interface" - fi - echo - continue - fi -done - -if [ $MADWIFI -eq 1 ] -then - sleep 1s -fi - -for iface in `iwconfig 2>/dev/null | egrep '(IEEE|ESSID|802\.11|WLAN)' | sed 's/^\([a-zA-Z0-9_.]*\) .*/\1/' | grep -v wifi` -do - getModule $iface - getDriver $iface - getStack $iface - getChipset $DRIVER $iface - - - if [ x$MAC80211 = "x1" ] - then - getPhy $iface - getNewMon - printf "$iface\t\t$CHIPSET\t$DRIVER - [$PHYDEV]" - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - if [ $USE_IW = 1 ] - then - IW_ERROR=`iw dev $iface interface add $MONDEV type monitor 2>&1 | grep "nl80211 not found"` - if [ x$IW_ERROR = "x" ] - then - sleep 1s - if [ ! -z $3 ] - then - if [ $3 -lt 1000 ] - then - iwconfig $MONDEV channel $3 >/dev/null 2>&1 - else - iwconfig $MONDEV freq "$3"000000 >/dev/null 2>&1 - fi - fi - ifconfig $MONDEV up - printf "\n\t\t\t\t(monitor mode enabled on $MONDEV)" - else - if [ -f /sys/class/ieee80211/"$PHYDEV"/add_iface ] - then - echo -n "$MONDEV" > /sys/class/ieee80211/"$PHYDEV"/add_iface - sleep 1s - if [ $3 -lt 1000 ] - then - iwconfig $MONDEV mode Monitor channel $3 >/dev/null 2>&1 - else - iwconfig $MONDEV mode Monitor freq "$3"000000 >/dev/null 2>&1 - fi - ifconfig $MONDEV up - printf "\n\t\t\t\t(monitor mode enabled on $MONDEV)" - else - printf "\n\nERROR: nl80211 support is disabled in your kernel.\nPlease recompile your kernel with nl80211 support enabled.\n" - fi - fi - else - if [ -f /sys/class/ieee80211/"$PHYDEV"/add_iface ] - then - echo -n "$MONDEV" > /sys/class/ieee80211/"$PHYDEV"/add_iface - sleep 1s - if [ $3 -lt 1000 ] - then - iwconfig $MONDEV mode Monitor channel $3 >/dev/null 2>&1 - else - iwconfig $MONDEV mode Monitor freq "$3"000000 >/dev/null 2>&1 - fi - ifconfig $MONDEV up - printf "\n\t\t\t\t(monitor mode enabled on $MONDEV)" - else - printf "\n\nERROR: Neither the sysfs interface links nor the iw command is available.\nPlease download and install iw from\n$IW_SOURCE\n" - fi - fi - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - z="`echo $iface | cut -b -${#MON_PREFIX}`" - if [ x$z = "x$MON_PREFIX" ] - then - if [ $USE_IW = 1 ] - then - IW_ERROR=`iw dev "$iface" interface del 2>&1 | grep "nl80211 not found"` - if [ x$IW_ERROR = "x" ] - then - printf " (removed)" - else - if [ -f /sys/class/ieee80211/"$PHYDEV"/remove_iface ] - then - echo -n "$iface" > /sys/class/ieee80211/"$PHYDEV"/remove_iface - printf " (removed)" - else - printf "\n\nERROR: nl80211 support is disabled in your kernel.\nPlease recompile your kernel with nl80211 support enabled.\n" - fi - fi - else - if [ -f /sys/class/ieee80211/"$PHYDEV"/remove_iface ] - then - echo -n "$iface" > /sys/class/ieee80211/"$PHYDEV"/remove_iface - printf " (removed)" - else - printf "\n\nERROR: Neither the sysfs interface links nor the iw command is available.\nPlease download and install iw from\n$IW_SOURCE\n" - fi - fi - else - ifconfig $iface down - iwconfig $iface mode managed - printf "\n\t\t\t\t(monitor mode disabled)" - fi - fi - echo - continue - fi - - - if [ x$DRIVER = "xorinoco" ] || [ x"`iwpriv $iface 2>/dev/null | grep get_rid`" != "x" ] || [ x"`iwpriv $iface 2>/dev/null | grep dump_recs`" != "x" ] - then - printf "$iface\t\tHermesI\t\torinoco" - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - cp $KISMET~ $KISMET 2>/dev/null && - echo "source=orinoco,$iface,HermesI" >>$KISMET - if [ $CH -lt 1000 ] - then - iwconfig $iface mode Monitor channel $CH >/dev/null 2>&1 - else - iwconfig $iface mode Monitor freq "$CH"000000 >/dev/null 2>&1 - fi - iwpriv $iface monitor 1 $CH >/dev/null 2>&1 - ifconfig $iface up - printf " (monitor mode enabled)" - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - ifconfig $iface down - iwpriv $iface monitor 0 >/dev/null 2>&1 - iwconfig $iface mode Managed >/dev/null 2>&1 - printf " (monitor mode disabled)" - fi - echo - continue - fi - - if [ x$DRIVER = "xrtl819xU" ] - then - printf "$iface\t\tRealtek 819x\trtl819xU" - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - startStdIface $iface $CH - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - stopStdIface $iface - fi - echo - continue - fi - - if [ x$DRIVER = "xipw2100" ] || [ x"`iwpriv $iface 2>/dev/null | grep set_crc_check`" != "x" ] - then - printf "$iface\t\tIntel 2100B\tipw2100" - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - cp $KISMET~ $KISMET 2>/dev/null && - echo "source=ipw2100,$iface,Centrino_b" >>$KISMET - startStdIface $iface $CH - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - stopStdIface $iface - fi - echo - continue - fi - - - if [ x$DRIVER = "xarusb_lnx" ] || [ x$DRIVER = "Otus" ] - then - printf "$iface\t\tAR9001USB\tOtus" - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - echo "Monitor mode not yet supported" - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - stopStdIface $iface - fi - echo - continue - fi - - if [ x$DRIVER = "xWiLink" ] - then - getChipset $iface - printf "$iface\t\t${CHIPSET}\t\t${DRIVER}" - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - printf "\n\t\t\t\tMonitor mode not yet supported" - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - stopStdIface $iface - fi - echo - continue - fi - - if [ x$DRIVER = "xipw2200" ] || [ x"`iwpriv $iface 2>/dev/null | grep sw_reset`" != "x" ] - then - MODINFO=`modinfo ipw2200 2>/dev/null | awk '/^version/ {print $2}'` - if { echo "$MODINFO" | grep -E '^1\.0\.(0|1|2|3)$' ; } - then - echo "Monitor mode not supported, please upgrade" - else - printf "$iface\t\tIntel 2200BG\tipw2200" - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - cp $KISMET~ $KISMET 2>/dev/null && - echo "source=ipw2200,$iface,Centrino_g" >>$KISMET - startStdIface $iface $CH - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - stopStdIface $iface - fi - - if { echo "$MODINFO" | grep -E '^1\.0\.(5|7|8|11)$' ; } - then - printf " (Warning: bad module version, you should upgrade)" - fi - fi - echo - continue - fi - - - if [ x$DRIVER = "xcx3110x" ] || [ x"`iwpriv $iface 2>/dev/null | grep set_backscan`" != "x" ] - then - printf "$iface\t\tNokia 770\t\tcx3110x" - if [ x$1 = "xstart" ] || [ x$1 = "xstop" ] - then - printf " (Enable/disable monitor mode not yet supported)" - fi - echo - continue - fi - - - if [ x$DRIVER = "xipw3945" ] || [ x"`iwpriv $iface 2>/dev/null | grep set_preamble | grep -v set_crc_check`" != "x" ] - then - printf "$iface\t\tIntel 3945ABG\tipw3945" - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - cp $KISMET~ $KISMET 2>/dev/null && - echo "source=ipw3945,$iface,Centrino_g" >>$KISMET - startStdIface $iface $CH - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - stopStdIface $iface - fi - echo - continue - fi - - - if [ x"`iwpriv $iface 2>/dev/null | grep inact_auth`" != "x" ] - then - if [ -e "/proc/sys/net/$iface/%parent" ] - then - printf "$iface\t\tAtheros\t\tmadwifi-ng VAP (parent: `cat /proc/sys/net/$iface/%parent`)" - if [ x$2 = x$iface ] && [ x$1 = "xstop" ] - then - wlanconfig $iface destroy - printf " (VAP destroyed)" - fi - if [ x$1 = "xstart" ] - then - if [ $iface = "$IFACE" ] - then - printf " (monitor mode enabled)" - fi - if [ x$2 = x$iface ] - then - printf " (VAP cannot be put in monitor mode)" - fi - fi - - echo "" - continue - - fi - printf "$iface\t\tAtheros\t\tmadwifi" - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - cp $KISMET~ $KISMET 2>/dev/null && - echo "source=madwifi_g,$iface,Atheros" >>$KISMET - startStdIface $iface $CH - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - stopStdIface $iface - fi - echo - continue - fi - - - if [ x$DRIVER = "xprism54" ] || [ x"`iwpriv $iface 2>/dev/null | grep getPolicy`" != "x" ] - then - printf "$iface\t\tPrismGT\t\tprism54" - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - cp $KISMET~ $KISMET 2>/dev/null && - echo "source=prism54g,$iface,Prism54" >>$KISMET - ifconfig $iface up - if [ $CH -lt 1000 ] - then - iwconfig $iface mode Monitor channel $CH - else - iwconfig $iface mode Monitor freq "$CH"000000 - fi - iwpriv $iface set_prismhdr 1 >/dev/null 2>&1 - printf " (monitor mode enabled)" - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - stopStdIface $iface - fi - echo - continue - fi - - - if [ x$DRIVER = "xhostap" ] || [ x"`iwpriv $iface 2>/dev/null | grep antsel_rx`" != "x" ] - then - printf "$iface\t\tPrism 2/2.5/3\tHostAP" - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - cp $KISMET~ $KISMET 2>/dev/null && - echo "source=hostap,$iface,Prism2" >>$KISMET - if [ $CH -lt 1000 ] - then - iwconfig $iface mode Monitor channel $CH - else - iwconfig $iface mode Monitor freq "$CH"000000 - fi - iwpriv $iface monitor_type 1 >/dev/null 2>&1 - ifconfig $iface up - printf " (monitor mode enabled)" - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - stopStdIface $iface - fi - echo - continue - fi - - - if [ x$DRIVER = "xwlan-ng" ] || [ x"`wlancfg show $iface 2>/dev/null | grep p2CnfWEPFlags`" != "x" ] - then - printf "$iface\t\tPrism 2/2.5/3\twlan-ng" - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - cp $KISMET~ $KISMET 2>/dev/null && - echo "source=wlanng,$iface,Prism2" >>$KISMET - wlanctl-ng $iface lnxreq_ifstate ifstate=enable >/dev/null - wlanctl-ng $iface lnxreq_wlansniff enable=true channel=$CH \ - prismheader=true wlanheader=false \ - stripfcs=true keepwepflags=true >/dev/null - echo p2CnfWEPFlags=0,4,7 | wlancfg set $iface - ifconfig $iface up - printf " (monitor mode enabled)" - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - ifconfig $iface down - wlanctl-ng $iface lnxreq_wlansniff enable=false >/dev/null - wlanctl-ng $iface lnxreq_ifstate ifstate=disable >/dev/null - printf " (monitor mode disabled)" - fi - echo - continue - fi - - - if [ x$SYSFS = "x" ] && [ x"`iwpriv $iface 2>/dev/null | grep get_RaAP_Cfg`" != "x" ] - then - if [ x"`iwconfig $iface | grep ESSID | awk -F\ '{ print $2}' | grep -i rt61`" != "x" ] - then - printf "$iface\t\tRalink 2561 PCI\trt61" - fi - - if [ x"`iwconfig $iface | grep ESSID | awk -F\ '{ print $2}' | grep -i rt73`" != "x" ] - then - printf "$iface\t\tRalink 2573 USB\trt73" - fi - - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - startStdIface $iface $CH - iwpriv $iface rfmontx 1 - if [ x"`iwpriv $iface 2>/dev/null | grep forceprismheader`" != "x" ] - then - iwpriv $iface forceprismheader 1 - fi - if [ x"`iwpriv $iface 2>/dev/null | grep forceprism`" != "x" ] - then - iwpriv $iface forceprism 1 - fi - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - stopStdIface $iface - fi - echo - continue - - fi - - - if [ x$DRIVER = "xrt61" ] - then - printf "$iface\t\tRalink 2561 PCI\trt61" - - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - startStdIface $iface $CH - iwpriv $iface rfmontx 1 - if [ x"`iwpriv $iface 2>/dev/null | grep forceprismheader`" != "x" ] - then - iwpriv $iface forceprismheader 1 - fi - if [ x"`iwpriv $iface 2>/dev/null | grep forceprism`" != "x" ] - then - iwpriv $iface forceprism 1 - fi - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - stopStdIface $iface - fi - echo - continue - - fi - - - if [ x$DRIVER = "xrt73" ] - then - printf "$iface\t\tRalink 2573 USB\trt73" - - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - startStdIface $iface $CH - iwpriv $iface rfmontx 1 - if [ x"`iwpriv $iface 2>/dev/null | grep forceprismheader`" != "x" ] - then - iwpriv $iface forceprismheader 1 - fi - if [ x"`iwpriv $iface 2>/dev/null | grep forceprism`" != "x" ] - then - iwpriv $iface forceprism 1 - fi - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - stopStdIface $iface - fi - echo - continue - - fi - - - if [ x$DRIVER = "xrt2500" ] || [ x"`iwpriv $iface 2>/dev/null | grep bbp`" != "x" ] - then - printf "$iface\t\tRalink 2560 PCI\trt2500" - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - cp $KISMET~ $KISMET 2>/dev/null && - echo "source=rt2500,$iface,Ralink_g" >>$KISMET - iwconfig $iface mode ad-hoc 2> /dev/null >/dev/null - startStdIface $iface $CH - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - stopStdIface $iface - fi - echo - continue - fi - - - if [ x$DRIVER = "xrt2570" ] || [ x"`iwpriv $iface 2>/dev/null | grep wpapsk`" != "x" ] && [ x"`iwpriv $iface 2>/dev/null | grep get_RaAP_Cfg`" = "x" ] - then - printf "$iface\t\tRalink 2570 USB\trt2570" - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - cp $KISMET~ $KISMET 2>/dev/null && - echo "source=rt2500,$iface,Ralink_g" >>$KISMET - iwconfig $iface mode ad-hoc 2> /dev/null >/dev/null - startStdIface $iface $CH - if [ x"`iwpriv $iface 2>/dev/null | grep forceprismheader`" != "x" ] - then - iwpriv $iface forceprismheader 1 - fi - if [ x"`iwpriv $iface 2>/dev/null | grep forceprism`" != "x" ] - then - iwpriv $iface forceprism 1 - fi - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - stopStdIface $iface - fi - echo - continue - fi - - - if [ x$DRIVER = "xr8180" ] || [ x"`iwpriv $iface 2>/dev/null | grep debugtx`" != "x" ] - then - printf "$iface\t\tRTL8180/RTL8185\tr8180" - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - cp $KISMET~ $KISMET 2>/dev/null && - echo "source=rt8180,$iface,Realtek" >>$KISMET - if [ $CH -lt 1000 ] - then - iwconfig $iface mode Monitor channel $CH - else - iwconfig $iface mode Monitor freq "$CH"000000 - fi - if [ x"`iwpriv $iface 2>/dev/null | grep prismhdr`" != "x" ] - then - iwpriv $iface prismhdr 1 >/dev/null 2>&1 - fi - ifconfig $iface up - printf " (monitor mode enabled)" - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - stopStdIface $iface - fi - echo - continue - fi - - - if [ x$DRIVER = "xr8187" ] || [ x"`iwpriv $iface 2>/dev/null | grep badcrc`" != "x" ] - then - printf "$iface\t\tRTL8187\t\tr8187" - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - cp $KISMET~ $KISMET 2>/dev/null && - echo "source=rt8180,$iface,Realtek" >>$KISMET - if [ $CH -lt 1000 ] - then - iwconfig $iface mode Monitor channel $CH - else - iwconfig $iface mode Monitor freq "$CH"000000 - fi - if [ x"`iwpriv $iface 2>/dev/null | grep rawtx`" != "x" ] - then - iwpriv $iface rawtx 1 >/dev/null 2>&1 - fi - ifconfig $iface up - printf " (monitor mode enabled)" - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - stopStdIface $iface - fi - echo - continue - fi - - - if [ x$DRIVER = "xzd1211rw" ] || [ x"`iwpriv $iface 2>/dev/null | grep get_regdomain`" != "x" ] - then - printf "$iface\t\tZyDAS 1211\tzd1211rw" - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - cp $KISMET~ $KISMET 2>/dev/null && - echo "source=zd1211,$iface,ZyDAS" >>$KISMET - startStdIface $iface $CH - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - stopStdIface $iface - fi - echo - continue - fi - - - if [ x$DRIVER = "xzd1211" ] || [ x"`iwpriv $iface 2>/dev/null | grep dbg_flag`" != "x" ] - then - printf "$iface\t\tZyDAS 1211\tzd1211" - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - cp $KISMET~ $KISMET 2>/dev/null && - echo "source=zd1211,$iface,ZyDAS" >>$KISMET - startStdIface $iface $CH - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - stopStdIface $iface - fi - echo - continue - fi - - - if [ x$DRIVER = "xacx" ] || [ x"`iwpriv $iface 2>/dev/null | grep GetAcx1`" != "x" ] - then - printf "$iface\t\tTI ACX1xx\tacx" - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - cp $KISMET~ $KISMET 2>/dev/null && - echo "source=acx100,$iface,TI" >>$KISMET - iwpriv $iface monitor 2 $CH 2> /dev/null >/dev/null - startStdIface $iface $CH - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - stopStdIface $iface - fi - echo - continue - fi - - - if [ x$DRIVER = "xbcm43xx" ] || [ x"`iwpriv $iface 2>/dev/null | grep write_sprom`" != "x" ] - then - printf "$iface\t\tBroadcom\tbcm43xx" - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - cp $KISMET~ $KISMET 2>/dev/null && - echo "source=bcm43xx,$iface,broadcom" >>$KISMET - startStdIface $iface $CH - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - stopStdIface $iface - ifconfig $iface up - fi - echo - continue - fi - - - if [ x$DRIVER = "xislsm" ] || [ x"`iwpriv $iface 2>/dev/null | grep set_announcedpkt`" != "x" ] - then - printf "$iface\t\tPrismGT\t\tislsm" - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - startStdIface $iface $CH - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - stopStdIface $iface - fi - echo - continue - - fi - - - if [ x$DRIVER = "xat76c503a" ] || [ x"`iwpriv $iface 2>/dev/null | grep set_announcedpkt`" != "x" ] - then - printf "$iface\t\tAtmel\t\tat76c503a" - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - startStdIface $iface $CH - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - stopStdIface $iface - fi - echo - continue - - fi - - - if [ x$DRIVER = "xndiswrapper" ] || [ x"`iwpriv $iface 2>/dev/null | grep ndis_reset`" != "x" ] - then - printf "$iface\t\tUnknown\t\tndiswrapper" - if [ x$2 = x$iface ] - then - echo " (MONITOR MODE NOT SUPPORTED)" - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - stopStdIface $iface - fi - echo - continue - fi - - - if [ x$DRIVER != "x" ] - then - if [ x$CHIPSET = "x" ] - then - printf "$iface\t\tUNKNOWN\t\t$DRIVER" - else - printf "$iface\t\t$CHIPSET\t\t$DRIVER" - fi - - if [ x$1 = "xstart" ] && [ x$2 = x$iface ] - then - startStdIface $iface $CH - fi - if [ x$1 = "xstop" ] && [ x$2 = x$iface ] - then - stopStdIface $iface - fi - echo - continue - fi - -printf "$iface\t\tUnknown\t\tUnknown (MONITOR MODE NOT SUPPORTED)\n" - -done - -################################ < STOP > ######################### diff --git a/lib/exitmode.sh b/lib/exitmode.sh deleted file mode 100644 index 8aace28..0000000 --- a/lib/exitmode.sh +++ /dev/null @@ -1,99 +0,0 @@ -function exitmode { - if [ $FLUX_DEBUG != 1 ]; then - conditional_clear - top - echo -e "\n\n"$white"["$red"-"$white"] "$red"$general_exitmode"$transparent"" - - if ps -A | grep -q aireplay-ng; then - echo -e ""$white"["$red"-"$white"] "$white"Kill "$grey"aireplay-ng"$transparent"" - killall aireplay-ng &>$flux_output_device - fi - - if ps -A | grep -q airodump-ng; then - echo -e ""$white"["$red"-"$white"] "$white"Kill "$grey"airodump-ng"$transparent"" - killall airodump-ng &>$flux_output_device - fi - - if ps a | grep python| grep fakedns; then - echo -e ""$white"["$red"-"$white"] "$white"Kill "$grey"python"$transparent"" - kill $(ps a | grep python| grep fakedns | awk '{print $1}') &>$flux_output_device - fi - - if ps -A | grep -q hostapd; then - echo -e ""$white"["$red"-"$white"] "$white"Kill "$grey"hostapd"$transparent"" - killall hostapd &>$flux_output_device - fi - - if ps -A | grep -q lighttpd; then - echo -e ""$white"["$red"-"$white"] "$white"Kill "$grey"lighttpd"$transparent"" - killall lighttpd &>$flux_output_device - fi - - if ps -A | grep -q dhcpd; then - echo -e ""$white"["$red"-"$white"] "$white"Kill "$grey"dhcpd"$transparent"" - killall dhcpd &>$flux_output_device - fi - - if ps -A | grep -q mdk3; then - echo -e ""$white"["$red"-"$white"] "$white"Kill "$grey"mdk3"$transparent"" - killall mdk3 &>$flux_output_device - fi - - if [ "$WIFI_MONITOR" != "" ]; then - echo -e ""$weis"["$rot"-"$weis"] "$weis"$general_exitmode_1 "$green"$WIFI_MONITOR"$transparent"" - airmon-ng stop $WIFI_MONITOR &> $flux_output_device - fi - - if [ "$WIFI" != "" ]; then - echo -e ""$weis"["$rot"-"$weis"] "$weis"$general_exitmode_2 "$green"$WIFI"$transparent"" - airmon-ng stop $WIFI &> $flux_output_device - macchanger -p $WIFI &> $flux_output_device - fi - - if [ "$(cat /proc/sys/net/ipv4/ip_forward)" != "0" ]; then - echo -e ""$white"["$red"-"$white"] "$white"$general_exitmode_3"$transparent"" - sysctl -w net.ipv4.ip_forward=0 &>$flux_output_device - fi - - echo -e ""$white"["$red"-"$white"] "$white"$general_exitmode_4"$transparent"" - if [ ! -f $DUMP_PATH/iptables-rules ];then - iptables --flush - iptables --table nat --flush - iptables --delete-chain - iptables --table nat --delete-chain - else - iptables-restore < $DUMP_PATH/iptables-rules - fi - - echo -e ""$white"["$red"-"$white"] "$white"$general_exitmode_5"$transparent"" - tput cnorm - - if [ $FLUX_DEBUG != 1 ]; then - - echo -e ""$white"["$red"-"$white"] "$white"Delete "$grey"files"$transparent"" - rm -R $DUMP_PATH/* &>$flux_output_device - fi - - if [ $KEEP_NETWORK = 0 ]; then - - echo -e ""$white"["$red"-"$white"] "$white"$general_exitmode_6"$transparent"" - # systemctl check - systemd=`whereis systemctl` - if [ "$systemd" = "" ];then - service network-manager restart &> $flux_output_device & - service networkmanager restart &> $flux_output_device & - service networking restart &> $flux_output_device & - else - systemctl restart NetworkManager &> $flux_output_device & - fi - echo -e ""$white"["$green"+"$white"] "$green"$general_exitmode_7"$transparent"" - echo -e ""$white"["$green"+"$white"] "$grey"$general_exitmode_8"$transparent"" - sleep 2 - clear - fi - - fi - - exit - -} diff --git a/siteinstaller.py b/siteinstaller.py deleted file mode 100755 index 92da12a..0000000 --- a/siteinstaller.py +++ /dev/null @@ -1,307 +0,0 @@ -#!/usr/bin/env python -# -*- coding: cp852 -*- - -import sys -import getopt -import os -import subprocess -sys.path.insert(0, './locale') - -# ################### -# ## OPTIONS ######## -# ################### -site_name = '' -site_language = '' -installed_sites = 0 -flux_cont = '' -#flux_comp_versions = ['0.24'] -flinstall_version = '0.11' -# ################### -class color: - PURPLE = '\033[95m' - CYAN = '\033[96m' - DARKCYAN = '\033[36m' - BLUE = '\033[94m' - GREEN = '\033[92m' - YELLOW = '\033[93m' - RED = '\033[91m' - BOLD = '\033[1m' - UNDERLINE = '\033[4m' - END = '\033[0m' - -def main(argv): - global site_name, site_language - if os.geteuid() != 0: - exit('You need to have root privileges to run this script.\nPlease try again, this time using \'sudo\'. Exiting....') - sys.exit() - usage = '>>>\tUsage:\n' +'\t\tsiteinstaller.py -f ' +'\n\t\tsiteinstaller.py --file \n\n>>>\tOnly *.tar.gz compressed files!' - try: - opts, args = getopt.getopt(sys.argv[1:], 'f:h', ['file=', 'help']) - if(len(opts) <= 0): - print(usage) - sys.exit() - except getopt.GetoptError: - print(usage) - sys.exit(2) - - for opt, arg in opts: - if opt in ('-h', '--help'): - print(usage) - sys.exit(2) - elif opt in ('-f', '--file'): - if not('.tar.gz' in arg): - print('ONLY *.tar.gz files supported.') - sys.exit() - if(os.path.isfile(arg) == False): - print('Your file does not exist, maybe a typo?') - sys.exit() - site_name = arg[:arg.rfind('.tar.gz')] - site_language = site_name[site_name.rfind('_')+1:] - else: - print(usage) - - -if __name__ == "__main__": - main(sys.argv[1:]) - -# Language Selector -print('\033[1;91m [~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]') -print(' [ ]') -print(' [ FluxIon - Site Installer v' + flinstall_version + ' ]') -print('\033[94m [ ]') -print(' [~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]') -print('\033[39m') -print(' # Select your language:') -print('') -print('[1] English') -print('[2] German') -print('') -lang = raw_input(' [#]:') -if(lang == '1'): - from en_EN import language -elif(lang == '2'): - from de_DE import language -else: - from en_EN import language - -# ############### - -def check_fluxion(): - global installed_sites, flux_cont - try: - fl = open('fluxion','rw') - flux_cont = fl.read() - fl.close() - except: - print(language.COULD_NOT_OPEN_FLUX) - sys.exit() - if(flux_cont <= 100): - print(language.NO_FLUXION_FOUND) - sys.exit() - flv = '' - flr = '' - fld = '' - if('version=' in flux_cont) and ('revision=' in flux_cont): - flv = flux_cont[flux_cont.find('version=')+8:] - flv = flv[:flv.find('\n')] - flr = flux_cont[flux_cont.find('revision=')+9:] - flr = flr[:flr.find('\n')] - else: - print(language.CORRUPTED_FLUX) - sys.exit() - - # Version check - #vchk = False - #for version in flux_comp_versions: - # if(version == flv): - # vchk = True - #if(vchk == False): - # print('Your fluxion version '+color.BOLD + flv + color.END + '. \nSupported versions are - ' + ' - '.join(reversed(flux_comp_versions))) - # sys.exit() - # ############### - - installed_sites = int(flux_cont.count('elif [ "$webconf" =')) - fls = str(installed_sites + 1) - - # Check on double installation! - fld = flux_cont[flux_cont.find('$DUMP_PATH/data/index.htm'):] - if(site_name in fld): - usdc = raw_input(language.DOUBLE_INSTALL + ' "' + site_name + '" ' + language.CONTINUE_ANYWAY + ' [Y\\n]') - if(len(usdc) <= 0) or (usdc == 'y') or (usdc == 'yes'): - pass - else: - sys.exit() - # ############### - - return flv + '#' + flr + '#' + fls - -def welcome(): - flc = check_fluxion().split('#') - wsn = int(22 - len(site_name)) - whitespacen = '' - wsl = int((22+6) - len(site_language)) - whitespacel = '' - for i in xrange(wsn): - whitespacen += ' ' - if(i+1 == wsn) and (i+1 <= wsn): - whitespacen += '#' - for i in xrange(wsl): - whitespacel += ' ' - if(i+1 == wsl) and (i+1 <= wsl): - whitespacel += '#' - - print('\033[1;91m [~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]') - print(' [ ]') - print(' [ FluxIon - Site Installer v'+ flinstall_version + ' ]') - print('\033[94m [ ]') - print(' [~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]') - print('\033[39m') - print(' # ############## FluxIon found! ##############') - print(' # \033[39mVersion: '+ flc[0] +' #') - print(' # \033[39mRevision: '+ flc[1] +' #') - print(' # \033[39mInstalled Sites: '+ flc[2] +' #') - print(' # ############################################') - print('') - print(' # ############################################') - print(' # \033[39mSiteName to install: ' + site_name + whitespacen) - print(' # \033[39mLanguage flag: ' + site_language + whitespacel) - print(' # ############################################') - print('') - print(' # ########### Everything correct? ############') - print('') - usc = raw_input(' # ' + language.BEGIN_INSTALL + '? [Y\\n]').lower() - if(len(usc) <= 0) or (usc == 'y') or (usc == 'yes'): - pass - else: - print('\n\t # ' + language.NOTHING_CHANGED) - sys.exit() - -# ######################################################################################## -# ######################################################################################## -# ######################################################################################## -# ######################################################################################## -# ######################################################################################## -# ######################################################################################## -# ######################################################################################## -welcome() - -# ###### First INSERT -def insert_at_secondlast_pos1(): - global flux_cont, site_name, site_language - whitespaces = '' - search_string = 'echo -e " "$red"["$yellow"$n"$red"]"$transparent"\e' - ws = int(12 - len(site_name)) - for i in xrange(ws): - whitespaces+=' ' - insert_site = 'echo -e " "$red"["$yellow"$n"$red"]"$transparent" ' + site_name + whitespaces + '[' + site_language + '] ";n=` expr $n + 1`\n' - before = flux_cont[:int(flux_cont.rfind(search_string))] - after = '\t\t\t' + flux_cont[int(flux_cont.rfind(search_string)):] - flux_cont = before + insert_site + after -# ########################################## - -# ###### Second INSERT -def insert_at_secondlast_pos2(): - global installed_sites, flux_cont, site_name - site_number = str(installed_sites +1) - insert_site = 'elif [ "$webconf" = "'+ site_number +'" ]; then\n\t\t\t\t' + site_name + '\n\t\t\t\tbreak\n\n\t\t\t' - flux_cont = flux_cont[:int(flux_cont.rfind('elif [ "$webconf" ='))] + insert_site + flux_cont[int(flux_cont.rfind('elif [ "$webconf" =')):] - -def last_option_correct_number2(): - global installed_sites, flux_cont - acc = int(flux_cont.rfind('elif [ "$webconf" =')) - acc0 = int(flux_cont[acc:].find('" = "')+5) - before = flux_cont[:acc+acc0] - after = flux_cont[acc+acc0+2:] - flux_cont = before + str(installed_sites+2) + after -# ########################################## - -# ###### Third INSERT -def insert_at_last_pos3(): - global flux_cont, site_name - insert_site = '\n\nfunction ' + site_name + ' {\n\tmkdir $DUMP_PATH/data &>$flux_output_device\n\tcp $WORK_DIR/Sites/' + site_name + '/* $DUMP_PATH/data\n\t}' - before = flux_cont[:int(flux_cont.rfind('}'))+1] - after = flux_cont[int(flux_cont.rfind('}'))+1:] - flux_cont = before + insert_site + after -# ########################################## - -print('') -print(' # '+ language.CREATING_BACKUP +'...') -try: - subprocess.Popen(['cp','fluxion', 'bckp_fluxion']) -except: - print(language.NO_PERM) - sys.exit() -print(' # ' + language.DONE + '!') - -print('') -print(' # ' + language.COPYING_FILES + '...') -try: - subprocess.Popen(['tar','xfz', site_name + '.tar.gz', '-C', 'Sites/']) -except: - print(language.COULD_NOT_COPY + '...') - sys.exit() -print(' # ' + language.DONE + '!') - -print('') -print(' # ' + language.RECONFIGURE_FLUXION_BASH + '...') -try: - insert_at_secondlast_pos1() - insert_at_secondlast_pos2() - last_option_correct_number2() - insert_at_last_pos3() -except: - print(language.INTERNAL_FAILURE + '...') - e = sys.exc_info()[0] - print(language.ERROR + ": %s" % e ) - sys.exit() - -print(' # ' + language.DONE + '!') - -print('') -print(' # '+ language.REWRITING_FLUXION_BASH + '...') -try: - wflux = open('fluxion','w') - wflux.write(flux_cont) - wflux.close() -except: - print(language.FATAL_ERROR + '[501]...') - print(language.TRYING_TO_RESTORE_BACKUP) - try: - subprocess.Popen(['mv','bckp_fluxion', 'fluxion']) - print('FluxIon ' + language.BACKUP_RESTORED + '...') - except: - print(language.FATAL_ERROR + '[502]...') - sys.exit() -print(' # ' + language.DONE + '!') - -print('') -print(' # ' + language.SETTING_MODES + '...') -try: - subprocess.Popen(['chmod','755', 'Sites/' + site_name +'/']) - subprocess.Popen(['chmod','644', '-R', 'Sites/' + site_name +'/']) - print(' # ' + DONE + '!') -except: - pass - #print('ERROR[506]... ' + language.CONTINUE + '...') - #print("Unexpected error:", sys.exc_info()[0]) - -print('') -print(' # ' + language.VERIFYING_INTEG + '...') -try: - fluxit = open('fluxion','r') - integ_fluxion = fluxit.read() - fluxit.close() - if(len(integ_fluxion) == len(flux_cont)): - print(' # ' + language.DONE + '!') - print(' # ' + language.DELETING_BACKUP + '...') - subprocess.Popen(['rm','bckp_fluxion']) - else: - print(language.FATAL_ERROR + '[509]...') - sys.exit() -except: - print(language.FATAL_ERROR + '[503]...') - sys.exit() - -print('\n # ' + site_name + '" ' + language.SUCCESS + '!') - - diff --git a/sites b/sites deleted file mode 160000 index ff349e7..0000000 --- a/sites +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ff349e7e612fdad12b41afcc37d5a34229b4c267