|
|
@ -3,11 +3,23 @@ |
|
|
|
# |
|
|
|
# |
|
|
|
|
|
|
|
|
|
|
|
format="$(cat "$__object/parameter/format")" |
|
|
|
format="$(cat "$__object/parameter/format")" |
|
|
|
state="$(cat "$__object/parameter/state")" |
|
|
|
state_should="$(cat "$__object/parameter/state")" |
|
|
|
|
|
|
|
|
|
|
|
diskimage="/$__object_id" |
|
|
|
diskimage="/$__object_id" |
|
|
|
|
|
|
|
|
|
|
|
# Absent is ensured by __file, present by gencode-remote |
|
|
|
case "$state_should" in |
|
|
|
if [ "$state" = "absent" ]; then |
|
|
|
present) |
|
|
|
__file "$diskimage" --state absent |
|
|
|
if [ ! -f "$__object/parameter/size" ]; then |
|
|
|
fi |
|
|
|
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 |
|
|
|