WAIT extension pauses until switch position changes

This commit is contained in:
Darren Kitchen 2018-01-30 22:10:24 -08:00 committed by GitHub
parent 4df763c4a4
commit 032061688d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,17 @@
#!/bin/bash
#
# WAIT v1 by @Hak5Darren
# Waits blocks the payload from continuing until the switch position has changed
# Usage: WAIT
function WAIT() {
GET SWITCH_POSITION
TEST=$SWITCH_POSITION
while true
do GET SWITCH_POSITION
if [ $SWITCH_POSITION != $TEST ]; then break; fi
sleep 1
done
}
export -f WAIT