punktdateien/bash/jobrunner/runjob.sh

15 lines
396 B
Bash
Executable file

#!/bin/bash
if [ -z "${*}" ]; then
echo ":: Error: No command supplied"
exit 1
fi
if [ -a "/tmp/jobrunner" ] && [ ! -d "/tmp/jobrunner" ]; then
echo ":: Error: \"/tmp/jobrunner\" is not a directory, aborting."
else
if [ ! -f "/tmp/jobrunner/jobrunner.pid" ]; then
echo ":: Error: The jobrunner daemon is not running."
exit 1
fi
fi
echo "${@}" &> "/tmp/jobrunner/jobrunner.cmd"