Merge pull request #23 from WatskeBart/patch-1

Update DuckyInstall install.sh
This commit is contained in:
Sebastian Kinne 2017-03-10 09:58:48 +11:00 committed by GitHub
commit 76be68b96d

View File

@ -2,27 +2,8 @@
# Based on bashbunnypayloads installer
# https://github.com/hak5/bashbunny-payloads/blob/master/payloads/library/tools_installer/install.sh
##
# Switch Position
##
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
# Check Switch Position
source bunny_helpers.sh
TARGET_DIR='/root/tools'
RELEASE_ARCHIVE=$(find /root/udisk/payloads/${SWITCH_POSITION} -name DuckToolkit-*)
@ -90,4 +71,4 @@ EOF
LED R G B
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