diff options
| author | Sadeep Madurange <sadeep@asciimx.com> | 2026-08-22 10:41:25 +0800 |
|---|---|---|
| committer | Sadeep Madurange <sadeep@asciimx.com> | 2026-08-22 10:41:25 +0800 |
| commit | 1458b2b562bb0d2e0328bae45480bbbb635b71f2 (patch) | |
| tree | dac47d9b18bac1f23cad3471c938afca9c899fa9 /install.lexd_spool.sh | |
| parent | 0682cf927984628bcae3e6bcbff7022ae5ff0aa6 (diff) | |
| download | lex-1458b2b562bb0d2e0328bae45480bbbb635b71f2.tar.gz | |
Install scripts, run file for spool processor.
Diffstat (limited to 'install.lexd_spool.sh')
| -rw-r--r-- | install.lexd_spool.sh | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/install.lexd_spool.sh b/install.lexd_spool.sh new file mode 100644 index 0000000..e613c5d --- /dev/null +++ b/install.lexd_spool.sh @@ -0,0 +1,43 @@ +#!/bin/ksh +# +# install.lexd_spool.sh - install lexd-spool binary and rc.d script. +# +# Usage: doas ./install.lexd_spool.sh + +set -e + +BIN_SRC="./lexd-spool.sh" +BIN_DST="/usr/local/bin/lexd-spool" +RC_SRC="./lexd-spool.rc" +RC_DST="/etc/rc.d/lexd_spool" + +if [ "$(id -u)" -ne 0 ]; then + echo "error: this script must be run as root" >&2 + exit 1 +fi + +if [ ! -f "$BIN_SRC" ]; then + echo "error: $BIN_SRC not found" >&2 + exit 1 +fi + +if [ ! -f "$RC_SRC" ]; then + echo "error: $RC_SRC not found" >&2 + exit 1 +fi + +if [ ! -e "$BIN_DST" ]; then + echo "installing $BIN_DST" + install -o root -g wheel -m 0755 "$BIN_SRC" "$BIN_DST" +else + echo "$BIN_DST already exists, skipping" +fi + +if [ ! -e "$RC_DST" ]; then + echo "installing $RC_DST" + install -o root -g wheel -m 0555 "$RC_SRC" "$RC_DST" +else + echo "$RC_DST already exists, skipping" +fi + +echo "done." |
