6b0f8fba22
Solves SC2034 references #540.
26 lines
598 B
Bash
Executable file
26 lines
598 B
Bash
Executable file
#!/bin/sh -e
|
|
#
|
|
################################################################################
|
|
# Default settings
|
|
#
|
|
|
|
state_should="$(cat "$__object/parameter/state")"
|
|
|
|
diskimage="/$__object_id"
|
|
|
|
case "$state_should" in
|
|
present)
|
|
if [ ! -f "$__object/parameter/size" ]; then
|
|
echo "Size is required when state is present" >&2
|
|
exit 1
|
|
fi
|
|
;;
|
|
absent)
|
|
# Absent is ensured by __file, present by gencode-remote
|
|
__file "$diskimage" --state absent
|
|
;;
|
|
*)
|
|
echo "Unsupported state: $state_should" >&2
|
|
exit 1
|
|
;;
|
|
esac
|