ioemu/view

21 lines
663 B
Plaintext
Raw Permalink Normal View History

2018-01-28 16:42:13 +00:00
#!/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;