2020-09-10 10:11:34 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
SERVICE="nano-run"
|
|
|
|
RUNNING_USER="${SERVICE}"
|
|
|
|
|
|
|
|
if ! id -u ${RUNNING_USER}; then
|
|
|
|
echo "Creating user ${RUNNING_USER}..."
|
|
|
|
useradd -M -c "${RUNNING_USER} dummy user" -r -s /bin/nologin ${RUNNING_USER}
|
|
|
|
fi
|
2020-09-11 12:19:33 +00:00
|
|
|
chown -R nano-run:nano-run /var/nano-run/
|
2020-09-10 10:11:34 +00:00
|
|
|
systemctl enable "${SERVICE}".service || echo "failed to enable service"
|
|
|
|
systemctl start "${SERVICE}".service || echo "failed to start service"
|