2020-06-20 22:13:30 +00:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
2020-06-28 13:38:15 +00:00
|
|
|
download="$( cat "$__object/parameter/download" )"
|
|
|
|
|
|
|
|
state_is="$( cat "$__object/explorer/state" )"
|
|
|
|
|
|
|
|
if [ "$download" = 'remote' ] && [ "$state_is" != 'present' ]
|
|
|
|
then
|
|
|
|
cmd="$( cat "$__object/explorer/remote_cmd" )"
|
|
|
|
|
|
|
|
url="$( cat "$__object/parameter/url" )"
|
|
|
|
|
|
|
|
dst="/$__object_id"
|
|
|
|
|
|
|
|
printf "$cmd > %s\n" \
|
|
|
|
"$url" \
|
|
|
|
"$dst"
|
|
|
|
|
|
|
|
echo 'downloaded' > "$__messages_out"
|
|
|
|
fi
|
|
|
|
|
2020-07-08 10:43:55 +00:00
|
|
|
if [ -f "$__object/parameter/onchange" ] && [ "$state_is" != "present" ]
|
2020-06-20 22:13:30 +00:00
|
|
|
then
|
|
|
|
cat "$__object/parameter/onchange"
|
|
|
|
fi
|