mirror of
https://github.com/IceWhaleTech/CasaOS.git
synced 2025-11-06 22:59:44 +00:00
arch_support
This commit is contained in:
parent
60608c5dc7
commit
6c7e2afa43
40
build/scripts/setup/service.d/casaos/arch/setup-casaos.sh
Normal file
40
build/scripts/setup/service.d/casaos/arch/setup-casaos.sh
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
###
|
||||||
|
# @Author: LinkLeong link@icewhale.org
|
||||||
|
# @Date: 2022-08-25 11:41:22
|
||||||
|
# @LastEditors: LinkLeong
|
||||||
|
# @LastEditTime: 2022-08-31 17:54:17
|
||||||
|
# @FilePath: /CasaOS/build/scripts/setup/service.d/casaos/debian/setup-casaos.sh
|
||||||
|
# @Description:
|
||||||
|
|
||||||
|
# @Website: https://www.casaos.io
|
||||||
|
# Copyright (c) 2022 by icewhale, All Rights Reserved.
|
||||||
|
###
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
APP_NAME="casaos"
|
||||||
|
|
||||||
|
# copy config files
|
||||||
|
CONF_PATH=/etc/casaos
|
||||||
|
OLD_CONF_PATH=/etc/casaos.conf
|
||||||
|
CONF_FILE=${CONF_PATH}/${APP_NAME}.conf
|
||||||
|
CONF_FILE_SAMPLE=${CONF_PATH}/${APP_NAME}.conf.sample
|
||||||
|
|
||||||
|
|
||||||
|
if [ -f "${OLD_CONF_PATH}" ]; then
|
||||||
|
echo "copy old conf"
|
||||||
|
cp "${OLD_CONF_PATH}" "${CONF_FILE}"
|
||||||
|
fi
|
||||||
|
if [ ! -f "${CONF_FILE}" ]; then
|
||||||
|
echo "Initializing config file..."
|
||||||
|
cp -v "${CONF_FILE_SAMPLE}" "${CONF_FILE}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -rf /etc/systemd/system/casaos.service # remove old service file
|
||||||
|
|
||||||
|
systemctl daemon-reload
|
||||||
|
|
||||||
|
# enable service (without starting)
|
||||||
|
echo "Enabling service..."
|
||||||
|
systemctl enable --force --no-ask-password "${APP_NAME}.service"
|
||||||
Loading…
x
Reference in New Issue
Block a user