From 1458b2b562bb0d2e0328bae45480bbbb635b71f2 Mon Sep 17 00:00:00 2001 From: Sadeep Madurange Date: Sat, 22 Aug 2026 10:41:25 +0800 Subject: Install scripts, run file for spool processor. --- install.lexd_spool.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 install.lexd_spool.sh (limited to 'install.lexd_spool.sh') 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." -- cgit v1.2.3