diff --git a/ioemu/view b/ioemu/view new file mode 100755 index 0000000..c7488d7 --- /dev/null +++ b/ioemu/view @@ -0,0 +1,21 @@ +#!/bin/bash + + +# (1) Primary init. +#--------------------------------------------------------# +# (1) Get absolute folder # +ROOT=$(dirname `realpath $0`); + +# (2) Check lock file # +test ! -f $ROOT/.lock && echo "Daemon not started" && exit 1; + +# (3) Check argument # +test $# -lt 1 && echo -e "ERR: Missing argument\n\n\tgpio\tGPIO real-time view\n\tsystemd\tSystemd real-time dependency tree\n\tlogs\tLogs real-time view\n" && exit 1; + +# (4) Check argument binds to an actual file # +test ! -f $ROOT/sub-view/$1 && echo -e "ERR: No such value for argument" && exit 1; + + +# (2) Start sub-view +#--------------------------------------------------------# +$ROOT/sub-view/$1; \ No newline at end of file