|
|
@ -21,26 +21,30 @@ |
|
|
|
# __file is a very basic type, which will probably be reused quite often |
|
|
|
# __file is a very basic type, which will probably be reused quite often |
|
|
|
# |
|
|
|
# |
|
|
|
|
|
|
|
|
|
|
|
destination="/$__object_id" |
|
|
|
process="$__object_id" |
|
|
|
|
|
|
|
|
|
|
|
# No source? Create empty file |
|
|
|
runs="$(cat "$__object/explorer/runs")" |
|
|
|
if [ ! -f "$__object/parameter/source" ]; then |
|
|
|
state="$(cat "$__object/parameter/state")" |
|
|
|
if [ no = "$(cat "$__object/explorer/exists")" ]; then |
|
|
|
|
|
|
|
echo touch \"$destination\" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Mode settings |
|
|
|
case "$state" in |
|
|
|
if [ -f "$__object/parameter/mode" ]; then |
|
|
|
running) |
|
|
|
echo chmod \"$(cat "$__object/parameter/mode")\" \"$destination\" |
|
|
|
# Does not run, start it! |
|
|
|
fi |
|
|
|
if [ -z "$runs" ]; then |
|
|
|
|
|
|
|
if [ -f "$__object/parameter/start" ]; then |
|
|
|
# Group |
|
|
|
cat "$__object/parameter/start" |
|
|
|
if [ -f "$__object/parameter/group" ]; then |
|
|
|
else |
|
|
|
echo chgrp \"$(cat "$__object/parameter/group")\" \"$destination\" |
|
|
|
echo "$process" |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
fi |
|
|
|
# Owner |
|
|
|
;; |
|
|
|
if [ -f "$__object/parameter/owner" ]; then |
|
|
|
stopped) |
|
|
|
echo chown \"$(cat "$__object/parameter/owner")\" \"$destination\" |
|
|
|
# Runs, kill it! |
|
|
|
fi |
|
|
|
if [ "$runs" ]; then |
|
|
|
|
|
|
|
if [ -f "$__object/parameter/stop" ]; then |
|
|
|
|
|
|
|
cat "$__object/parameter/stop" |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
echo kill "${runs}" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
;; |
|
|
|
|
|
|
|
esac |
|
|
|