-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhstools
executable file
·61 lines (45 loc) · 2.63 KB
/
hstools
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
#HSTOOLS for managing hotspot
#20200425 KM4ACK
#side note: written during covid-19 outbreak of 2020
#MYPATH=$HOME/hotspot-tools2
MYPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
VERSION=$(cat $MYPATH/changelog | grep version= | sed 's/version=//')
source $MYPATH/functions
#Verify not running as root
WHO=$(whoami)
if [ $WHO = 'root' ]; then
echo "no need to run with sudo"
exit
fi
yad --form --width=400 --text="<b>HotSpot Tools\rversion $VERSION</b>\rby KM4ACK and WB0SIO" --text-align=center --center --title="HotSpot Tools" --text-align=center \
--image $HOME/hotspot-tools2/logo.png --window-icon=$HOME/hotspot-tools2/logo.png --image-on-top \
--field="STATUS":RO "$HS" \
--field="STATE":RO "$HSS" \
--field="SSID":RO "$CURRENTNAME" \
--field="PASSWORD":RO "$CURRENTPASS" \
--field="IP ADDR":RO "$HSIP" \
--field="FORCE MODE":RO "$FORCE" \
--field="Change Name/Password":fbtn 'bash -c "kill -USR1 $YAD_PID; source /home/pi/hotspot-tools2/functions; namepwd"' \
--field="Change IP Address":fbtn 'bash -c "kill -USR1 $YAD_PID; source /home/pi/hotspot-tools2/functions; ipaddress"' \
--field="Run Hotspot Check":fbtn 'bash -c "kill -USR1 $YAD_PID; source /home/pi/hotspot-tools2/functions; hotspot"' \
--field="Force Hotspot":fbtn 'bash -c "kill -USR1 $YAD_PID; source /home/pi/hotspot-tools2/functions; FORCE"' \
--field="Undo Force Hotspot":fbtn 'bash -c "kill -USR1 $YAD_PID; source /home/pi/hotspot-tools2/functions; RESTORE"' \
--field="Disable Hotspot":fbtn "bash -c 'source $MYPATH/functions; disable'" \
--field="Enable Hotspot":fbtn "bash -c 'source $MYPATH/functions; enable'" \
--field="Manage SSIDs":fbtn 'bash -c "kill -USR1 $YAD_PID; source /home/pi/hotspot-tools2/functions; MANAGESSID"' \
--field="DHCP List":fbtn 'bash -c "kill -USR1 $YAD_PID; source /home/pi/hotspot-tools2/functions; DHCPLIST"' \
--field="Auto Hotspot Check <b>$AUTORUN</b>":fbtn 'bash -c "kill -USR1 $YAD_PID; source /home/pi/hotspot-tools2/functions; AUTOCHECK"' \
--button=gtk-quit:1
QUIT=$?
if [ $QUIT = 1 ] || [ $QUIT = 252 ]; then
exit
fi
#old info left for reference.
#--field="Change Name/Password":fbtn "bash -c 'source $MYPATH/functions; namepwd'" \
#--field="Run Hotspot":fbtn "bash -c 'source $MYPATH/functions; hotspot'" \
#--field="Disable Hotspot":fbtn "bash -c 'source $MYPATH/functions; disable'" \
#--field="Enable Hotspot":fbtn "bash -c 'source $MYPATH/functions; enable'" \
#--field="Manage SSIDs":fbtn "bash -c 'source $MYPATH/functions; MANAGESSID'" \
#--field="DHCP List":fbtn "bash -c 'source $MYPATH/functions; DHCPLIST'" \
#--field="Update":fbtn 'bash -c "kill -USR1 $YAD_PID; source /home/pi/Pi-APRS/functions; MYCONFIG"' \