From dbed7e5692cbdc768d3c0573729f1bfe62f6e79d Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sun, 28 Jan 2018 17:02:54 +0100 Subject: [PATCH] now view launches sub-view program --- ioemu/view | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 ioemu/view 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