mirror of
https://github.com/KaySar12/NextZen-UserService.git
synced 2025-03-15 15:15:35 +07:00
Create setup-user-service.sh
This commit is contained in:
parent
1d6136bfd5
commit
e002bab12a
@ -0,0 +1,22 @@
|
||||
#!/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"
|
Loading…
Reference in New Issue
Block a user