24 lines
470 B
Bash
24 lines
470 B
Bash
#!/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
|