mystic/mrc-server/install-v1.sh
2024-04-20 14:49:31 +02:00

29 lines
1.4 KiB
Bash

if [ $MRCSERVER = "Yes" ]; then
msg_info "Setting up Multi Relay Chat Server for ${APP}"
apt install -y build-essential &>/dev/null
wget -N https://sourceforge.net/projects/mystic-relay-chat/files/mrc_${MRC_SERVER_VER}.zip -O $MSTEMPDIR/mrc${MRC_SERVER_VER}.zip &>/dev/null
rm -rf $MSTEMPDIR/mrc${MRC_SERVER_VER} &>/dev/null
mkdir -p $MSTEMPDIR/mrc${MRC_SERVER_VER} &>/dev/null
pushd $MSTEMPDIR/mrc${MRC_SERVER_VER} &>/dev/null
unzip ../mrc${MRC_SERVER_VER}.zip &>/dev/null
cp mrc_server.py ${MYSTIC_DIR}/
cp sysop.doc ${MYSTIC_DIR}/docs/mrc_server_sysop.doc
cp whatsnew.txt ${MYSTIC_DIR}/docs/mrc_server_whatsnew.txt
cp servers.lst ${MYSTIC_DIR}/docs/mrc_server_server.lst
popd &>/dev/null
mkdir -p ${MYSTIC_DIR}/data/mrc &>/dev/null
msg_ok "Setting up Multi Relay Chat Server for ${APP}"
msg_info "Installing Multi Relay Chat Server Systemd Start/Stop Scripts and Service File"
pushd $MSTEMPDIR/mystic/mrc-server &>/dev/null
sed -e "s!@MYSTIC_DIR@!${MYSTIC_DIR}!g" mrc_server-start.sh > ${MYSTIC_DIR}/mrc_server-start
chmod +x ${MYSTIC_DIR}/mrc_server-start
sed -e "s!@MYSTIC_DIR@!${MYSTIC_DIR}!g" mrc_server-stop.sh > ${MYSTIC_DIR}/mrc_server-stop
chmod +x ${MYSTIC_DIR}/mrc_server-stop
sed -e "s!@MYSTIC_DIR@!${MYSTIC_DIR}!g" mrc-server.service > /etc/systemd/system/mrc-server.service
systemctl daemon-reload
popd &>/dev/null
msg_ok "Installing Multi Relay Chat Server Systemd Start/Stop Scripts and Service File"
fi