Add check for the state parameter in manifest.

This only allow following cases:
  - present
  - absent
else, it will abort with an error message.
This commit is contained in:
matze 2020-02-15 08:21:24 +01:00
parent e5d86ffc93
commit a761d4842c

View file

@ -22,3 +22,12 @@ if [ -f "$__object/parameter/raw" ] && [ -f "$__object/parameter/raw_command" ];
echo "ERROR: both raw and raw_command specified" >&2
exit 1
fi
case "$(cat "$__object/parameter/state" 2>/dev/null || echo "present")" in
present) ;;
absent) ;;
*)
echo "ERROR: unkown cron state" >&2
exit 2
esac