put prompt/install/config into own files

This commit is contained in:
Mario Fetka
2024-04-20 10:00:07 +02:00
parent 294dce1e74
commit f5dba27ec6
23 changed files with 143 additions and 134 deletions

View File

@@ -2,10 +2,10 @@
MYSTIC_DIR="$1"
sed -e "s!@MYSTIC_DIR@!${MYSTIC_DIR}!g" mrc-start.sh > ${MYSTIC_DIR}/mrc-start
chmod +x ${MYSTIC_DIR}/mrc-start
sed -e "s!@MYSTIC_DIR@!${MYSTIC_DIR}!g" mrc-stop.sh > ${MYSTIC_DIR}/mrc-stop
chmod +x ${MYSTIC_DIR}/mrc-stop
sed -e "s!@MYSTIC_DIR@!${MYSTIC_DIR}!g" mrc.service > /etc/systemd/system/mrc.service
sed -e "s!@MYSTIC_DIR@!${MYSTIC_DIR}!g" mrc_client-start.sh > ${MYSTIC_DIR}/mrc_client-start
chmod +x ${MYSTIC_DIR}/mrc_client-start
sed -e "s!@MYSTIC_DIR@!${MYSTIC_DIR}!g" mrc_client-stop.sh > ${MYSTIC_DIR}/mrc_client-stop
chmod +x ${MYSTIC_DIR}/mrc_client-stop
sed -e "s!@MYSTIC_DIR@!${MYSTIC_DIR}!g" mrc-client.service > /etc/systemd/system/mrc-client.service
systemctl daemon-reload

View File

@@ -2,9 +2,9 @@
MYSTIC_DIR="$1"
sed -e "s!@MYSTIC_DIR@!${MYSTIC_DIR}!g" mrc-start.sh > ${MYSTIC_DIR}/mrc_client-start
sed -e "s!@MYSTIC_DIR@!${MYSTIC_DIR}!g" mrc_client-start.sh > ${MYSTIC_DIR}/mrc_client-start
chmod +x ${MYSTIC_DIR}/mrc_client-start
sed -e "s!@MYSTIC_DIR@!${MYSTIC_DIR}!g" mrc-stop.sh > ${MYSTIC_DIR}/mrc_client-stop
sed -e "s!@MYSTIC_DIR@!${MYSTIC_DIR}!g" mrc_client-stop.sh > ${MYSTIC_DIR}/mrc_client-stop
chmod +x ${MYSTIC_DIR}/mrc_client-stop
sed -e "s!@MYSTIC_DIR@!${MYSTIC_DIR}!g" mrc-client.service > /etc/systemd/system/mrc-client.service
systemctl daemon-reload

View File

@@ -1,33 +0,0 @@
#==================================================================================================
# This systemd service file can be used to start and stop the 'Multi Relay Chat' python script as #
# a proper service module. In order for it to work correctly, it must be set to 'Type=forking'. #
# As a forking service, it will decide if start/stop was a failure based on the returned error #
# code. A return of 0 will be considered success, and a return of 1 will be a failure. The MRC #
# python script should ideally be launched as the same user who owns the mystic directories. To #
# do this, be sure to uncomment and set the 'User=' option in the [Service] section below. If you #
# don't, the script will be executed as root, which may have security implications. This file is #
# indended to work with Debian, Ubuntu, Raspbian and other debian based distributions, but may #
# work with others as well. #
# #
# Be sure to set the location of your mrc-start.sh and mrc-stop.sh scripts in the [Service] #
# section below, and to optionally set your user as described above. #
#==================================================================================================
[Unit]
Description=Multi Relay Chat for Mystic BBS
After=network.target
After=systemd-user-sessions.service
After=network-online.target
[Service]
Restart=on-failure
RestartSec=5s
Type=forking
# Be sure to set 'User' below to the user who owns your mystic directory.
User=mystic
# Ensure that the paths and filenames below are correct.
ExecStart=@MYSTIC_DIR@/mrc-start
ExecStop=@MYSTIC_DIR@/mrc-stop
[Install]
WantedBy=multi-user.target

0
mrc-client/prompt-v1.sh Normal file
View File