#!/bin/bash
do_cmd()
{
SECONDS=0
echo
echo "$(date +%Y-%m-%d\ %H:%M:%S) executing..."
"$@"
ret=$?
if [[ $ret -eq 0 ]]
then
echo "Successfully ran [ $* ]"
duration=$SECONDS
# total=$SECONDS
echo "$((duration / 60)) minutes and $((duration % 60)) seconds elapsed."
echo "---"
else
echo "Error: Command [ $* ] returned $ret"
exit $ret
fi
}
main ()
{
echo "$(date +%Y-%m-%d\ %H:%M:%S) Starting..."
do_cmd wget https://github.com/electron/asar/archive/v0.14.6.zip
do_cmd wget https://github.com/kubernetes/kubernetes/releases/download/v1.13.2/kubernetes.tar.gz
do_cmd wget https://github.com/kubernetes/kubernetes/archive/v1.13.2.zip
echo "$(date +%Y-%m-%d\ %H:%M:%S) Success"
}
time main
echo
Last active
January 18, 2019 06:38
-
-
Save aidmax/340213ab37146de0967931f8f5823ce3 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment