Last active
July 19, 2019 06:24
-
-
Save ibobcode/94581bed857183f68fb72109b1d88b29 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
allowed_time=$(date -d '+10 hour' +%H:%M:%S) | |
testnwrap() { | |
./test.sh | |
tar -cf results.tar /fs | |
cp results.tar /fs | |
cp results.log /fs | |
} | |
end() { | |
read -n 1 -p "> Once done, please enter [y] : " endinput | |
printf "\n" | |
if [ "$endinput" = "y" ]; then | |
printf "> Wrapping up your work ! " | |
sleep 1 | |
printf "...\n" | |
testnwrap | |
sleep 1 | |
printf "> All done ! You can now go back to the newbee webapp !" | |
else | |
sleep 1 | |
end | |
fi | |
} | |
test() { | |
printf "> Countdown started : go to the working folder (you have till %s ) \n" $allowed_time | |
printf '\n' | |
sleep 1 | |
end | |
} | |
echo "---------- WELCOME TO YOUR NEWBEE TEST! ---------" | |
printf "\n" | |
sleep 1 | |
printf "> Downloading your test ... " | |
curl -s -o test.sh https://gist.githubusercontent.com/ibobcode/9ad17e2b27b17330d71f9ffebbf24fd3/raw | |
chmod 777 test.sh | |
sleep 1 | |
printf "... \n" | |
sleep 1 | |
printf "> Done !\n" | |
sleep 1 | |
read -n 1 -p "> Do you want to start your test ? [yN]: " mainmenuinput | |
printf "\n" | |
if [ "$mainmenuinput" = "y" ]; then | |
test | |
else | |
printf "> Ok, no problem, just start the docker again when you feel ready ! See you !\n" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment