syncs github version with current live version

This commit is contained in:
Alex Flores
2016-09-24 20:01:34 -04:00
parent 8a6d706112
commit ed01e46ed6

430
wp6.sh
View File

@@ -2,6 +2,8 @@
# WiFi Pineapple Connector for Linux # WiFi Pineapple Connector for Linux
# EULA https://www.wifipineapple.com/licence/eula.txt # EULA https://www.wifipineapple.com/licence/eula.txt
# License https://www.wifipineapple.com/licence/software_licence.txt # License https://www.wifipineapple.com/licence/software_licence.txt
wpver=6.5
spineapplenmask=255.255.255.0 spineapplenmask=255.255.255.0
spineapplenet=172.16.42.0/24 spineapplenet=172.16.42.0/24
spineapplelan=eth1 spineapplelan=eth1
@@ -9,200 +11,298 @@ spineapplewan=wlan0
spineapplegw=192.168.1.1 spineapplegw=192.168.1.1
spineapplehostip=172.16.42.42 spineapplehostip=172.16.42.42
spineappleip=172.16.42.1 spineappleip=172.16.42.1
sfirsttime=1
if [ "$EUID" -ne 0 ] if [ "$EUID" -ne 0 ]
then echo "This WiFi Pineapple Connection script requires root." then echo "This WiFi Pineapple Connection script requires root."
sudo su -s "$0"
exit exit
fi fi
function banner {
# Show random banner because 1337
b=$(( ( RANDOM % 5 ) + 1 ))
case "$b" in
1)
echo $(tput setaf 3)
echo " _ ___ _______ ____ _ __ ";
echo " | | / (_) ____(_) / __ \\(_)___ ___ ____ _____ ____ / /__ ";
echo " | | /| / / / /_ / / / /_/ / / __ \/ _ \/ __ '/ __ \/ __ \/ / _ \\";
echo " | |/ |/ / / __/ / / / ____/ / / / / __/ /_/ / /_/ / /_/ / / __/ ";
echo " |__/|__/_/_/ /_/ /_/ /_/_/ /_/\___/\__,_/ .___/ .___/_/\___/ ";
echo " $(tput setaf 3)/_/ /_/$(tput sgr0) v$wpver";
;;
2)
echo $(tput setaf 3)
echo " ___ __ ___ __ __ ___ ";
echo " | | | |__ | |__) | |\ | |__ /\ |__) |__) | |__ ";
echo " |/\| | | | | | | \| |___ /~~\ | | |___ |___ ";
echo " $(tput sgr0)v$wpver"
;;
3)
echo $(tput setaf 3)
echo " ▄▄▌ ▐ ▄▌▪ ·▄▄▄▪ ▄▄▄·▪ ▐ ▄ ▄▄▄ . ▄▄▄· ▄▄▄· ▄▄▄·▄▄▌ ▄▄▄ .";
echo " ██· █▌▐███ ▐▄▄·██ ▐█ ▄███ •█▌▐█▀▄.▀·▐█ ▀█ ▐█ ▄█▐█ ▄███• ▀▄.▀·";
echo " ██▪▐█▐▐▌▐█·██▪ ▐█· ██▀·▐█·▐█▐▐▌▐▀▀▪▄▄█▀▀█ ██▀· ██▀·██▪ ▐▀▀▪▄";
echo " ▐█▌██▐█▌▐█▌██▌.▐█▌ ▐█▪·•▐█▌██▐█▌▐█▄▄▌▐█ ▪▐▌▐█▪·•▐█▪·•▐█▌▐▌▐█▄▄▌";
echo " ▀▀▀▀ ▀▪▀▀▀▀▀▀ ▀▀▀ .▀ ▀▀▀▀▀ █▪ ▀▀▀ ▀ ▀ .▀ .▀ .▀▀▀ ▀▀▀ ";
echo " $(tput sgr0)v$wpver"
;;
4)
echo $(tput setaf 3)
echo " ▄ ▄ ▄█ ▄████ ▄█ █ ▄▄ ▄█ ▄ ▄███▄ ██ █ ▄▄ █ ▄▄ █ ▄███▄ ";
echo " █ █ ██ █▀ ▀ ██ █ █ ██ █ █▀ ▀ █ █ █ █ █ █ █ █▀ ▀";
echo "█ ▄ █ ██ █▀▀ ██ █▀▀▀ ██ ██ █ ██▄▄ █▄▄█ █▀▀▀ █▀▀▀ █ ██▄▄ ";
echo "█ █ █ ▐█ █ ▐█ █ ▐█ █ █ █ █▄ ▄▀ █ █ █ █ ███▄ █▄ ▄";
echo " █ █ █ ▐ █ ▐ █ ▐ █ █ █ ▀███▀ █ █ █ ▀ ▀███▀ ";
echo " ▀ ▀ ▀ ▀ █ ██ █ ▀ ▀ $(tput sgr0)v$wpver";
;;
5)
echo $(tput setaf 3)
echo " ( ( ";
echo " ( ( )\ ) )\ ) ( ";
echo " )\))( ' ( (()/( ( (()/( ( ( ) )\ ( ";
echo "((_)()\ ) )\ /(_)) )\ /(_)))\ ( ))\ ( /( \` ) \` ) ((_) ))\ ";
echo "_(())\_)()((_)(_))_|((_) (_)) ((_) )\ ) /((_))(_)) /(/( /(/( _ /((_) ";
echo "\ \((_)/ / (_)| |_ (_) | _ \ (_) _(_/( (_)) ((_)_ ((_)_\ ((_)_\ | |(_)) ";
echo " \ \/\/ / | || __| | | | _/ | || ' \))/ -_)/ _\` || '_ \)| '_ \)| |/ -_) ";
echo " \_/\_/ |_||_| |_| |_| |_||_||_| \___|\__,_|| .__/ | .__/ |_|\___| ";
echo " |_| |_| $(tput sgr0)v$wpver";
;;
esac
}
function showsettings {
printf "\n\
$(tput bold)Saved Settings$(tput sgr0): Share Internet connection from $spineapplewan\n\
to WiFi Pineapple at $spineapplelan through default gateway $spineapplegw\n"
}
function configure { function menu {
ifaces=($(ifconfig -a | grep encap | awk {'print $1'} | grep -v lo)) printf "\n\
[$(tput bold)C$(tput sgr0)]onnect using saved settings\n\
[$(tput bold)G$(tput sgr0)]uided setup (recommended)\n\
[$(tput bold)M$(tput sgr0)]anual setup\n\
[$(tput bold)A$(tput sgr0)]dvanced IP settings\n\
[$(tput bold)Q$(tput sgr0)]uit\n\n "
read -r -sn1 key
case "$key" in
[gG]) guidedsetup;;
[mM]) manualsetup;;
[cC]) connectsaved;;
[aA]) advancedsetup;;
[bB]) bunny;;
[qQ]) printf "\n"; exit;;
esac
}
printf "\nSelect WiFi Pineapple Interface:\n" function manualsetup {
for i in "${!ifaces[@]}"; do ipinstalled=$(which ip)
printf "\t%s)\t%s\t" "$i" "${ifaces[$i]}" if [[ "$?" == 0 ]]; then
printf "$(ifconfig ${ifaces[$i]} | grep 'inet addr' | awk {'print $2'} | sed 's/addr://g')\n" ifaces=($(ip link show | grep -v link | awk {'print $2'} | sed 's/://g' | grep -v lo))
done printf "\n Select WiFi Pineapple Interface:\n"
read -r -p "> " planq for i in "${!ifaces[@]}"; do
pineapplelan=(${ifaces[planq]}) printf " [$(tput bold)%s$(tput sgr0)]\t%s\t" "$i" "${ifaces[$i]}"
printf "$(ip -4 addr show ${ifaces[$i]} | grep inet | awk {'print $2'} | head -1)\n"
printf "\nSelect Internet Interface:\n" done
for i in "${!ifaces[@]}"; do read -r -p " > " planq
printf "\t%s)\t%s\t" "$i" "${ifaces[$i]}" if [ "$planq" -eq "$planq" ] 2>/dev/null; then
printf "$(ifconfig ${ifaces[$i]} | grep 'inet addr' | awk {'print $2'} | sed 's/addr://g')\n" spineapplelan=(${ifaces[planq]})
done else
read -r -p "> " inetq printf "\n Response must be a listed numeric option\n"; manualsetup
pineapplewan=(${ifaces[inetq]}) fi
printf "\n Select Internet Interface:\n"
gway=($(netstat -nr | grep $pineapplewan | grep -v ernel | grep -v ateway | awk {'print $2'} | grep -v 0.0.0.0)) for i in "${!ifaces[@]}"; do
if [ -z "$gway" ]; then printf " [$(tput bold)%s$(tput sgr0)]\t%s\t" "$i" "${ifaces[$i]}"
printf "\n$(netstat -nr)\n\nNo Gateway available for selected Internet Interface.\n\n" printf "$(ip -4 addr show ${ifaces[$i]} | grep inet | awk {'print $2'} | head -1)\n"
exit done
read -r -p " > " inetq
if [ "$inetq" -eq "$inetq" ] 2>/dev/null; then
spineapplewan=(${ifaces[inetq]})
else
printf "\n Response must be a listed numeric option\n"; manualsetup
fi
printf "\n$(netstat -nr)\n\n"
read -r -p " Specify Default Gateway IP Address: " spineapplegw
savechanges
else
printf "\n\n Configuration requires the 'iproute2' package (aka the 'ip' command).\n Please install 'iproute2' to continue.\n"
menu
fi fi
printf "\nChoose Internet Gateway:\n" }
for i in "${!gway[@]}"; do
printf "\t%s)\t%s\n" "$i" "${gway[$i]}"
done
read -r -p "> " gwayq
pineapplegw=(${gway[gwayq]})
printf "\n" function guidedsetup {
read -r -p "Keep default IP settings? [Y/n]? " defautip pineappledetected=$(ip addr | grep '00:[cC]0:[cC][aA]\|00:13:37' -B1 | awk {'print $2'} | head -1 | grep 'eth\|en')
case $defautip in if [[ "$?" == 0 ]]; then
printf "\n WiFi Pineapple detected. Please disconnect the WiFi Pineapple from\n this computer and $(tput bold)press any key$(tput sgr0) to continue with guided setup.\n "
read -r -sn1 anykey
guidedsetup
fi
hasiproute2=$(which ip)
if [[ "$?" == 1 ]]; then
printf "\n\n Configuration requires the 'iproute2' package (aka the 'ip' command).\n Please install 'iproute2' to continue.\n"; menu
fi
hasdefaultroute=$(ip route)
if [[ "$?" == 1 ]]; then
printf "\n No route detected. Check connection and try again.\n"; menu
fi
printf "\n $(tput setaf 3)Step 1 of 3: Select Default Gateway$(tput sgr0)\n\
Default gateway reported as $(tput bold)$(ip route | grep default | awk {'print $3'} | head -1)$(tput sgr0)\n"
read -r -p " Use the above reported default gateway? [Y/n]? " usedgw
case $usedgw in
[yY][eE][sS]|[yY]|'') [yY][eE][sS]|[yY]|'')
pineapplenet=172.16.42.0/24 spineapplegw=($(ip route | grep default | awk {'print $3'}))
pineapplenmask=255.255.255.0 ;;
pineapplehostip=172.16.42.42 [nN][oO]|[nN])
pineappleip=172.16.42.1 printf "\n$(ip route)\n\n"
read -r -p "Save settings for next session [Y/n]? " savechanges read -r -p " Specify the default gateway by IP address: " spineapplegw
case $savechanges in ;;
[yY][eE][sS]|[yY]|'') savechanges ;;
[nN][oO]|[nN])
read -r -p "Connect now [Y/n]? " qconnectnow
case $qconnectnow in
[yY][eE][sS]|[yY]|'') connectnow ;;
[nN][oO]|[nN]) exit ;;
esac ;;
esac ;;
[nN][oO]|[nN]) configure_ip ;;
esac esac
printf "\n $(tput setaf 3)Step 2 of 3: Select Internet Interface$(tput sgr0)\n\
Internet interface reported as $(tput bold)$(ip route | grep default | awk {'print $5'} | head -1)$(tput sgr0)\n"
read -r -p " Use the above reported Internet interface? [Y/n]? " useii
case $useii in
[yY][eE][sS]|[yY]|'')
spineapplewan=($(ip route | grep default | awk {'print $5'}))
;;
[nN][oO]|[nN])
printf "\n Available Network Interfaces:\n"
ifaces=($(ip link show | grep -v link | awk {'print $2'} | sed 's/://g' | grep -v lo))
for i in "${!ifaces[@]}"; do
printf " \t%s\t" "${ifaces[$i]}"
printf "$(ip -4 addr show ${ifaces[$i]} | grep inet | awk {'print $2'} | head -1)\n"
done
read -r -p " Specify the internet interface by name: " spineapplewan
;;
esac
printf "\n $(tput setaf 3)Step 3 of 3: Select WiFi Pineapple Interface$(tput sgr0)\n Please connect the WiFi Pineapple to this computer.\n "
a="0"
until pineappleiface=$(ip addr | grep '00:[cC]0:[cC][aA]\|00:13:37' -B1 | awk {'print $2'} | head -1 | grep 'eth\|en')
do
printf "."
sleep 1
a=$[$a+1]
if [[ $a == "51" ]]; then
printf "\n "
a=0
fi
done
printf "[Checking]"
sleep 5 # Wait as the system is likely to rename interface. Sleeping rather than more advanced error handling becasue reasons. Try: dmesg | tail | grep -E 'asix.*renamed'
pineappleiface=$(ip addr | grep '00:[cC]0:[cC][aA]\|00:13:37' -B1 | awk {'print $2'} | head -1 | grep 'eth\|en' | sed 's/://g')
printf "\n Detected WiFi Pineapple on interface $(tput bold)$pineappleiface$(tput sgr0)\n";
read -r -p " Use the above detected WiFi Pineapple interface? [Y/n]? " pi
case $pi in
[yY][eE][sS]|[yY]|'')
spineapplelan=$pineappleiface
;;
[nN][oO]|[nN])
printf "\n Available Network Interfaces:\n"
ifaces=($(ip link show | grep -v link | awk {'print $2'} | sed 's/://g' | grep -v lo))
for i in "${!ifaces[@]}"; do
printf " \t%s\t" "${ifaces[$i]}"
printf "$(ip -4 addr show ${ifaces[$i]} | grep inet | awk {'print $2'} | head -1)\n"
done
read -r -p " Specify the WiFi Pineapple interface by name: " spineapplelan
;;
esac
savechanges
} }
function advancedsetup {
function configure_ip { printf "\n\
echo "" By default the WiFi Pineapple resides on the $(tput bold)172.16.42.0/24$(tput sgr0) network\n\
read -r -p "WiFi Pineapple Network [172.16.42.0/24]: " pineapplenet with the IP Address $(tput bold)172.16.42.1$(tput sgr0) and Ethernet default route $(tput bold)172.16.42.42$(tput sgr0).\n\n\
if [[ $pineapplenet == '' ]]; then The WiFi Pineapple expects an Internet connection from 172.16.42.42 by\n\
pineapplenet=172.16.42.0/24 # Pineapple network. Default is 172.16.42.0/24 default, which this script aids in configuring. These IP addresses may\n\
fi be changed if desired by modifying network configs on the WiFi Pineapple.\n\n"
read -r -p " Continue with advanced IP config [y/N]? " qcontinue
read -r -p "WiFi Pineapple Netmask [255.255.255.0]: " pineapplenmask case $qcontinue in
if [[ $pineapplenmask == '' ]]; then [nN][oO]|[nN]|'') menu ;;
pineapplenmask=255.255.255.0 #Default netmask for /24 network [yY][eE][sS]|[yY])
fi read -r -p " WiFi Pineapple Network [172.16.42.0/24]: " spineapplenet
if [[ $spineapplenet == '' ]]; then
# read -r -p "Host Interface to WiFi Pineapple [eth1]: " pineapplelan spineapplenet=172.16.42.0/24 # Pineapple network. Default is 172.16.42.0/24
# if [[ $pineapplelan == '' ]]; then fi
# pineapplelan=eth1 # Interface connected to Pineapple read -r -p " WiFi Pineapple Netmask [255.255.255.0]: " spineapplenmask
# fi if [[ $spineapplenmask == '' ]]; then
spineapplenmask=255.255.255.0 #Default netmask for /24 network
# read -r -p "Host Interface to Internet [wlan0]: " pineapplewan fi
# if [[ $pineapplewan == '' ]]; then read -r -p " Host IP Address [172.16.42.42]: " spineapplehostip
# pineapplewan=wlan0 #i.e. wlan0 for wifi, ppp0 for 3g modem/dialup, eth0 for lan if [[ $spineapplehostip == '' ]]; then
# fi spineapplehostip=172.16.42.42 #IP Address of host computer
fi
# temppineapplegw=`netstat -nr | awk 'BEGIN {while ($3!="0.0.0.0") getline; print $2}'` #Usually correct by default read -r -p " WiFi Pineapple IP Address [172.16.42.1]: " spineappleip
# read -r -p "Internet Gateway [$temppineapplegw]: " pineapplegw if [[ $spineappleip == '' ]]; then
# if [[ $pineapplegw == '' ]]; then spineappleip=172.16.42.1 #Don't forget your towel
# pineapplegw=`netstat -nr | awk 'BEGIN {while ($3!="0.0.0.0") getline; print $2}'` #Usually correct by default fi
# fi printf "\n Advanced IP settings will be saved for future sessions.\n Default settings may be restored by selecting Advanced IP settings and\n pressing [ENTER] when prompted for IP settings.\n\n Press any key to continue"
savechanges
read -r -p "Host IP Address [172.16.42.42]: " pineapplehostip ;;
if [[ $pineapplehostip == '' ]]; then
pineapplehostip=172.16.42.42 #IP Address of host computer
fi
read -r -p "WiFi Pineapple IP Address [172.16.42.1]: " pineappleip
if [[ $pineappleip == '' ]]; then
pineappleip=172.16.42.1 #Don't forget your towel
fi
echo ""
read -r -p "Save settings for next session [Y/n]? " savechanges
case $savechanges in
[yY][eE][sS]|[yY]|'') savechanges ;;
[nN][oO]|[nN])
read -r -p "Connect now [Y/n]? " qconnectnow
case $qconnectnow in
[yY][eE][sS]|[yY]|'') connectnow ;;
[nN][oO]|[nN]) exit ;;
esac ;;
esac esac
} }
function savechanges { function savechanges {
sed -i "s/^spineapplenmask.*/spineapplenmask=$pineapplenmask/" $0 sed -i "s/^spineapplenmask.*/spineapplenmask=$spineapplenmask/" $0
sed -i "s&^spineapplenet.*&spineapplenet=$pineapplenet&" $0 sed -i "s&^spineapplenet.*&spineapplenet=$spineapplenet&" $0
sed -i "s/^spineapplelan.*/spineapplelan=$pineapplelan/" $0 sed -i "s/^spineapplelan.*/spineapplelan=$spineapplelan/" $0
sed -i "s/^spineapplewan.*/spineapplewan=$pineapplewan/" $0 sed -i "s/^spineapplewan.*/spineapplewan=$spineapplewan/" $0
sed -i "s/^spineapplegw.*/spineapplegw=$pineapplegw/" $0 sed -i "s/^spineapplegw.*/spineapplegw=$spineapplegw/" $0
sed -i "s/^spineapplehostip.*/spineapplehostip=$pineapplehostip/" $0 sed -i "s/^spineapplehostip.*/spineapplehostip=$spineapplehostip/" $0
sed -i "s/^spineappleip.*/spineappleip=$pineappleip/" $0 sed -i "s/^spineappleip.*/spineappleip=$spineappleip/" $0
echo "" sed -i "s/^sfirsttime.*/sfirsttime=0/" $0
read -r -p "Settings saved. Connect now [Y/n]? " qconnectnow sfirsttime=0
case $qconnectnow in printf "\n Settings saved.\n"
[yY][eE][sS]|[yY]|'') connectnow ;; showsettings
[nN][oO]|[nN]) exit ;; menu
esac
} }
function connectsaved {
if [[ "$sfirsttime" == "1" ]]; then
function connectnow { printf "\n Error: Settings unsaved. Run either Guided or Manual setup first.\n"; menu
echo "" fi
#echo "$(tput setaf 6) _ . $(tput sgr0) $(tput setaf 7)___$(tput sgr0) $(tput setaf 3)\||/$(tput sgr0) Internet: $pineapplegw - $pineapplewan" ifconfig $spineapplelan $spineapplehostip netmask $spineapplenmask up #Bring up Ethernet Interface directly connected to Pineapple
#echo "$(tput setaf 6) ( _ )_ $(tput sgr0) $(tput setaf 2)<-->$(tput sgr0) $(tput setaf 7)[___]$(tput sgr0) $(tput setaf 2)<-->$(tput sgr0) $(tput setaf 3),<><>,$(tput sgr0) Computer: $pineapplehostip" printf "Detecting WiFi Pineapple..."
#echo "$(tput setaf 6) (_ _(_ ,)$(tput sgr0) $(tput setaf 7)\___\\$(tput sgr0) $(tput setaf 3)'<><>'$(tput sgr0) Pineapple: $pineapplenet - $pineapplelan" until ping $spineappleip -c1 -w1 >/dev/null
printf "$(tput setaf 6) _ . $(tput sgr0) $(tput setaf 7)___$(tput sgr0) $(tput setaf 3)\||/$(tput sgr0) Internet: $pineapplewan\t$pineapplegw\n" do
printf "$(tput setaf 6) ( _ )_ $(tput sgr0) $(tput setaf 2)<-->$(tput sgr0) $(tput setaf 7)[___]$(tput sgr0) $(tput setaf 2)<-->$(tput sgr0) $(tput setaf 3),<><>,$(tput sgr0) Pineapple: $pineapplelan\t$pineapplehostip\n" printf "."
printf "$(tput setaf 6) (_ _(_ ,)$(tput sgr0) $(tput setaf 7)\___\\$(tput sgr0) $(tput setaf 3)'<><>'$(tput sgr0) Network: $pineapplenet\n\n" ifconfig $spineapplelan $spineapplehostip netmask $spineapplenmask up &>/dev/null
ifconfig $pineapplelan $pineapplehostip netmask $pineapplenmask up #Bring up Ethernet Interface directly connected to Pineapple sleep 1
done
printf "...found.\n\n"
printf " $(tput setaf 6) _ . $(tput sgr0) $(tput setaf 7)___$(tput sgr0) $(tput setaf 3)\||/$(tput sgr0)\n"
printf " $(tput setaf 6) ( _ )_ $(tput sgr0) $(tput setaf 2)<-->$(tput sgr0) $(tput setaf 7)[___]$(tput sgr0) $(tput setaf 2)<-->$(tput sgr0) $(tput setaf 3),<><>,$(tput sgr0)\n"
printf " $(tput setaf 6) (_ _(_ ,)$(tput sgr0) $(tput setaf 7)\___\\$(tput sgr0) $(tput setaf 3)'<><>'$(tput sgr0)\n"
ifconfig $spineapplelan $spineapplehostip netmask $spineapplenmask up #Bring up Ethernet Interface directly connected to Pineapple
echo '1' > /proc/sys/net/ipv4/ip_forward # Enable IP Forwarding echo '1' > /proc/sys/net/ipv4/ip_forward # Enable IP Forwarding
iptables -X #clear chains and rules iptables -X #clear chains and rules
iptables -F iptables -F
iptables -A FORWARD -i $pineapplewan -o $pineapplelan -s $pineapplenet -m state --state NEW -j ACCEPT #setup IP forwarding iptables -A FORWARD -i $spineapplewan -o $spineapplelan -s $spineapplenet -m state --state NEW -j ACCEPT #setup IP forwarding
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A POSTROUTING -t nat -j MASQUERADE iptables -A POSTROUTING -t nat -j MASQUERADE
route del default #remove default route route del default #remove default route
route add default gw $pineapplegw $pineapplewan #add default gateway route add default gw $spineapplegw $spineapplewan #add default gateway
echo "" printf "\n Browse to http://$spineappleip:1471\n\n"
echo "Browse to http://$pineappleip:1471"
echo ""
exit exit
} }
function bunny {
printf "\nNetmask $spineapplenmask\nPineapple Net $spineapplenet\nPineapple LAN $spineapplelan\nPineapple WAN $spineapplewan\nPineapple GW $spineapplegw\nPineapple IP $spineappleip\nHost IP $spineapplehostip\n"
function connectsaved { printf "\n$(lsusb | grep ASIX)\n\n$(ifconfig -a)\n\n$(route)\n\n$(dmesg | grep -E '[aA][sS][iI[[xX].*|00:[cC]0:[cC][aA]')\n"
pineapplenmask=$spineapplenmask printf "\n/)___(\ \n(='.'=)\n(\")_(\")\n"
pineapplenet=$spineapplenet exit
pineapplelan=$spineapplelan
pineapplewan=$spineapplewan
pineapplegw=$spineapplegw
pineapplehostip=$spineapplehostip
pineappleip=$spineappleip
connectnow
} }
banner #remove for less 1337
showsettings
echo "$(tput setaf 3) _ ___ _______ ____ _ __ " if [[ "$sfirsttime" == "1" ]]; then
echo " | | / (_) ____(_) / __ \\(_)___ ___ ____ _____ ____ / /__ " printf "
echo " | | /| / / / /_ / / / /_/ / / __ \/ _ \/ __ '/ __ \/ __ \/ / _ \\" Since this is the first time running the WP6 Internet Connection Sharing\n\
echo " | |/ |/ / / __/ / / / ____/ / / / / __/ /_/ / /_/ / /_/ / / __/" script, Guided setup is recommended to save initial configuration.\n\
echo " |__/|__/_/_/ /_/ /_/ /_/_/ /_/\___/\__,_/ .___/ .___/_/\___/ " Subsequent sessions may be quickly connected using saved settings.\n"
echo " $(tput setaf 3)/_/ /_/$(tput sgr0) v6.2" fi
echo "" menu
#echo "Netmask: $spineapplenmask"
#echo "Network: $spineapplenet"
#echo "LAN: $spineapplelan"
#echo "WAN: $spineapplewan"
#echo "Gateway: $spineapplegw"
#echo "Host PC: $spineapplehostip"
#echo "WiFi Pineapple: $spineappleip"
printf "$(tput setaf 6) _ . $(tput sgr0) $(tput setaf 7)___$(tput sgr0) $(tput setaf 3)\||/$(tput sgr0) Internet: $spineapplewan\t$spineapplegw\n"
printf "$(tput setaf 6) ( _ )_ $(tput sgr0) $(tput setaf 2)<-->$(tput sgr0) $(tput setaf 7)[___]$(tput sgr0) $(tput setaf 2)<-->$(tput sgr0) $(tput setaf 3),<><>,$(tput sgr0) Pineapple: $spineapplelan\t$spineapplehostip\n"
printf "$(tput setaf 6) (_ _(_ ,)$(tput sgr0) $(tput setaf 7)\___\\$(tput sgr0) $(tput setaf 3)'<><>'$(tput sgr0) Network: $spineapplenet\n\n"
read -r -p "Connect using saved settings [Y/n]? " usesettings
case $usesettings in
[yY][eE][sS]|[yY]|'') connectsaved ;;
[nN][oO]|[nN]) configure ;;
esac
echo "Invalid response"
exit