2 Commits 803518e37e ... f844431d3d

Author SHA1 Message Date
  Samuel W. Flint f844431d3d Update run script 9 months ago
  Samuel W. Flint 9f2935d031 Add some more error checking 9 months ago
1 changed files with 6 additions and 1 deletions
  1. 6 1
      background-job

+ 6 - 1
background-job

@@ -37,6 +37,11 @@ if [ -z "${NAME}" ] ; then
     exit 1
 fi
 
+if [ $# -lt 1 ] ; then
+    echo "A command is required." >&2
+    exit 1
+fi
+
 RUN_SCRIPT=$(mktemp)
 
 cat <<EOF > "${RUN_SCRIPT}"
@@ -99,8 +104,8 @@ cat <<EOF >> "${RUN_SCRIPT}"
 rm "\${OUTPUT_FILE}"
 rm "\${TIME_FILE}"
 rm "\${FN}"
-
 EOF
 
+chmod +x ${RUN_SCRIPT}
 screen -d -S ${NAME} -m ${RUN_SCRIPT}