We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8af5763 commit 9414683Copy full SHA for 9414683
scripts/reboot_now.sh
@@ -0,0 +1,19 @@
1
+#!/usr/bin/env bash
2
+
3
+set_job_status() {
4
+ STATUS=$1
5
6
+ JOB_STATUS_PATH="$(dirname "$0")/status"
7
8
+ echo -n "$STATUS" > "$JOB_STATUS_PATH"
9
+}
10
11
+# Set successful exit status for the job as otherwise it ends in PENDING and
12
+# ultimately FAILED because it shuts down before it gets to the point
13
+# where it reports back
14
+set_job_status "DONE"
15
16
+reboot
17
18
+# If the script reaches this point the command failed, and so we re-set the status accordingly
19
+set_job_status "FAILED"
0 commit comments