diff options
author | B. Watson <urchlay@slackware.uk> | 2022-08-20 21:43:38 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2022-08-27 22:50:20 +0700 |
commit | 346d647f43136be36d304c20267c52e5c180020a (patch) | |
tree | d154616103fda9343b7b200fd89f8c0f925fcdad /network/fujinet-pc/fujinet-pc.sh | |
parent | 8c2383418e0e09ab1a29ca9752e37fad621e60f5 (diff) |
network/fujinet-pc: Added (Linux port of FujiNet firmware)
Signed-off-by: Dave Woodfall <dave@slackbuilds.org>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/fujinet-pc/fujinet-pc.sh')
-rw-r--r-- | network/fujinet-pc/fujinet-pc.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/network/fujinet-pc/fujinet-pc.sh b/network/fujinet-pc/fujinet-pc.sh new file mode 100644 index 0000000000000..51e44f101e44b --- /dev/null +++ b/network/fujinet-pc/fujinet-pc.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +SHARE=/usr/share/fujinet-pc +EXE=/usr/libexec/fujinet-pc/fujinet + +if [ "$1" = "-help" -o "$1" = "--help" -o "$1" = "-h" ]; then + echo -n "Usage: $( basename $0 ) " + $EXE --help 2>&1 | grep '^Usage:' | cut -d' ' -f3- + exit 0 +fi + +FUJINET_HOME="${FUJINET_HOME:-$HOME/.fujinet-pc}" +if [ ! -e "$FUJINET_HOME" ]; then + echo "$FUJINET_HOME does not exist, populating from $SHARE" + mkdir -p "$FUJINET_HOME" || exit 1 + cp -a $SHARE/* "$FUJINET_HOME" || exit 1 +fi + +cd "$FUJINET_HOME" || exit 1 + +echo "Starting FujiNet" +$EXE "$@" +rc=$? + +# from sysexits.h +# #define EX_TEMPFAIL 75 /* temp failure; user is invited to retry */ +while [ $rc -eq 75 ]; do + echo "Restarting FujiNet" + $EXE "$@" + rc=$? +done + +echo "FujiNet ended with exit code $rc" |