mirror of
https://github.com/hak5darren/bashbunny-payloads.git
synced 2025-10-29 16:58:12 +00:00
Update install.sh
Check switch position already implemented in bunny_helpers.sh
This commit is contained in:
parent
21a48ea283
commit
3e67aaac00
@ -2,27 +2,8 @@
|
|||||||
# Based on bashbunnypayloads installer
|
# Based on bashbunnypayloads installer
|
||||||
# https://github.com/hak5/bashbunny-payloads/blob/master/payloads/library/tools_installer/install.sh
|
# https://github.com/hak5/bashbunny-payloads/blob/master/payloads/library/tools_installer/install.sh
|
||||||
|
|
||||||
##
|
# Check Switch Position
|
||||||
# Switch Position
|
source bunny_helpers.sh
|
||||||
##
|
|
||||||
|
|
||||||
check_switch() {
|
|
||||||
switch1=`cat /sys/class/gpio_sw/PA8/data`
|
|
||||||
switch2=`cat /sys/class/gpio_sw/PL4/data`
|
|
||||||
switch3=`cat /sys/class/gpio_sw/PL3/data`
|
|
||||||
if [ "x$switch1" = "x0" ] && [ "x$switch2" = "x1" ] && [ "x$switch3" = "x1" ]; then
|
|
||||||
SWITCH_POSITION="switch1"
|
|
||||||
elif [ "x$switch1" = "x1" ] && [ "x$switch2" = "x0" ] && [ "x$switch3" = "x1" ]; then
|
|
||||||
SWITCH_POSITION="switch2"
|
|
||||||
elif [ "x$switch1" = "x1" ] && [ "x$switch2" = "x1" ] && [ "x$switch3" = "x0" ]; then
|
|
||||||
SWITCH_POSITION="switch3"
|
|
||||||
else
|
|
||||||
SWITCH_POSITION="invalid"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
check_switch
|
|
||||||
|
|
||||||
|
|
||||||
TARGET_DIR='/root/tools'
|
TARGET_DIR='/root/tools'
|
||||||
RELEASE_ARCHIVE=$(find /root/udisk/payloads/${SWITCH_POSITION} -name DuckToolkit-*)
|
RELEASE_ARCHIVE=$(find /root/udisk/payloads/${SWITCH_POSITION} -name DuckToolkit-*)
|
||||||
@ -90,4 +71,4 @@ EOF
|
|||||||
LED R G B
|
LED R G B
|
||||||
|
|
||||||
fi
|
fi
|
||||||
cp /tmp/duck_installer.log /root/udisk/payloads/${SWITCH_POSITION}/install_log.txt
|
cp /tmp/duck_installer.log /root/udisk/payloads/${SWITCH_POSITION}/install_log.txt
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user