Skip to content

Instantly share code, notes, and snippets.

@xdtianyu
Last active December 31, 2018 11:45
Show Gist options
  • Save xdtianyu/aa339f6003604ef6a72f to your computer and use it in GitHub Desktop.
Save xdtianyu/aa339f6003604ef6a72f to your computer and use it in GitHub Desktop.
<?php
if (rand()%5==0) {
echo "1111";
} else {
echo "0000";
}
?>
#/bin/bash
URL="http://192.168.5.100/xxx.php"
check() {
RESULT=$(curl -s $URL)
echo $RESULT
if [ "$RESULT" -eq "1111" ] ; then
echo "again"
sleep 1
check
elif [ "$RESULT" -eq "0000" ] ; then
echo "exit"
exit 0
else
echo "error"
fi
}
check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment