37 lines
738 B
Bash
Executable file
37 lines
738 B
Bash
Executable file
#!/bin/sh
|
|
|
|
# requires the xbase and xfont sets
|
|
pkg_add poppler-utils tesseract tesseract-deu tesseract-eng
|
|
|
|
# rc script
|
|
cat <<'EOF'> /etc/rc.d/docstore
|
|
#!/bin/sh
|
|
|
|
daemon="/usr/local/sbin/docstore"
|
|
|
|
. /etc/rc.d/rc.subr
|
|
|
|
rc_cmd $1
|
|
EOF
|
|
chmod 555 /etc/rc.d/docstore
|
|
rcctl enable docstore
|
|
rcctl set docstore flags server -c /var/docstore/docstore.conf
|
|
|
|
# user and group
|
|
mkdir /var/docstore
|
|
groupadd docstore
|
|
useradd -d /var/docstore -s /sbin/nologin -g docstore docstore
|
|
chown docstore:docstore /var/docstore
|
|
|
|
# config
|
|
cat <<EOF> /var/docstore/docstore.conf
|
|
{
|
|
"run_dir": "/var/docstore",
|
|
"secret": "$(openssl rand -hex 32)"
|
|
}
|
|
EOF
|
|
chmod 640 /var/docstore/docstore.conf
|
|
chgrp docstore /var/docstore/docstore.conf
|
|
|
|
# start
|
|
rcctl start docstore
|