2022-08-15 18:58:08 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
2022-09-01 17:34:37 +00:00
|
|
|
readonly APP_NAME="casaos-user-service"
|
|
|
|
|
readonly APP_NAME_SHORT="user-service"
|
2022-08-15 18:58:08 -04:00
|
|
|
|
|
|
|
|
# copy config files
|
2022-09-01 17:34:37 +00:00
|
|
|
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
|
2022-08-15 18:58:08 -04:00
|
|
|
|
|
|
|
|
if [ ! -f "${CONF_FILE}" ]; then \
|
|
|
|
|
echo "Initializing config file..."
|
|
|
|
|
cp -v "${CONF_FILE_SAMPLE}" "${CONF_FILE}"; \
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
systemctl daemon-reload
|
|
|
|
|
|
2022-10-20 21:07:35 -04:00
|
|
|
# enable service (without starting)
|
2022-08-15 18:58:08 -04:00
|
|
|
echo "Enabling service..."
|
|
|
|
|
systemctl enable --force --no-ask-password "${APP_NAME}.service"
|