mirror of
https://github.com/KaySar12/NextZen-UserService.git
synced 2025-06-26 21:50:57 +07:00
23 lines
558 B
Bash
Executable File
23 lines
558 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
readonly APP_NAME="casaos-user-service"
|
|
readonly APP_NAME_SHORT="user-service"
|
|
|
|
# copy config files
|
|
readonly CONF_PATH=/etc/casaos
|
|
readonly CONF_FILE=${CONF_PATH}/${APP_NAME_SHORT}.conf
|
|
readonly CONF_FILE_SAMPLE=${CONF_PATH}/${APP_NAME_SHORT}.conf.sample
|
|
|
|
if [ ! -f "${CONF_FILE}" ]; then \
|
|
echo "Initializing config file..."
|
|
cp -v "${CONF_FILE_SAMPLE}" "${CONF_FILE}"; \
|
|
fi
|
|
|
|
systemctl daemon-reload
|
|
|
|
# enable service (without starting)
|
|
echo "Enabling service..."
|
|
systemctl enable --force --no-ask-password "${APP_NAME}.service"
|