blob: e613c5d4beff6c3daf6225be8aa76cefc3bc9a7c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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."
|