svchelper/app/bin/install

24 lines
470 B
Plaintext
Raw Normal View History

2024-04-23 02:34:16 +00:00
#!/usr/bin/env bash
"$APP" onearg "$@"
"$APP" exist "$1"
source "$APP" service_env "$1"
set +e
"$APP" stop "$1"
useradd -d "$SERVICE_HOME" "$SERVICE_USER"
set -e
if [ "$SERVICE_PRIVATE" = "1" ]; then
chown -hR "$SERVICE_USER" "$SERVICE_DIR"
chgrp -hR "$SERVICE_USER" "$SERVICE_DIR"
chmod -R o= "$SERVICE_DIR"
fi
for f in "$SERVICE_DIR/root"/*; do
if [ -e "$f" ]; then
mv "$f" "/"
fi
done
if [ -e "$SERVICE_DIR/install" ]; then
source "$SERVICE_DIR/install"
fi