24 lines
431 B
Bash
Executable File
24 lines
431 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ -z ""]
|
|
then
|
|
LABEL="UpskillChallengeNode"
|
|
fi
|
|
|
|
NODESTATE="indeterminate"
|
|
while [ "$NODESTATE" != "running" ]
|
|
do
|
|
OLDSTATE=$NODESTATE
|
|
NODESTATE=$(linode-cli linodes list --format 'status' --label "$LABEL" --text | tail -n 1)
|
|
if [ "$NODESTATE" = "status" ]
|
|
then
|
|
echo "No node detected."
|
|
exit 1
|
|
fi
|
|
|
|
if [ "$NODESTATE" != "$OLDSTATE" ]
|
|
then
|
|
echo "$(date '+%F %T'): $NODESTATE"
|
|
fi
|
|
done
|