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

29 lines
1.4 KiB
Bash

if [ $MRCCLIENT = "Yes" ]; then
msg_info "Setting up Multi Relay Chat for ${APP}"
apt install -y build-essential &>/dev/null
wget -N https://www.phenomprod.com/releases/mystic/pn-mrc${MRC_VER}.zip -O $MSTEMPDIR/pn-mrc${MRC_VER}.zip &>/dev/null
rm -rf $MSTEMPDIR/pn-mrc${MRC_VER} &>/dev/null
mkdir -p $MSTEMPDIR/pn-mrc${MRC_VER} &>/dev/null
pushd $MSTEMPDIR/pn-mrc${MRC_VER} &>/dev/null
unzip ../pn-mrc${MRC_VER}.zip &>/dev/null
cp mrc_${MRC_VER}/mrc_{client,config}.py ${MYSTIC_DIR}/
cp mrc_${MRC_VER}/scripts/* ${MYSTIC_DIR}/themes/default/scripts/
cp mrc_${MRC_VER}/text/* ${MYSTIC_DIR}/themes/default/text/
cp installation.asc ${MYSTIC_DIR}/docs/mrc_installation.asc
popd &>/dev/null
mkdir -p ${MYSTIC_DIR}/data/mrc &>/dev/null
msg_ok "Setting up Multi Relay Chat for ${APP}"
msg_info "Installing Multi Relay Chat Systemd Start/Stop Scripts and Service File"
pushd $MSTEMPDIR/mystic/mrc-client &>/dev/null
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
popd &>/dev/null
systemctl daemon-reload
msg_ok "Installing Multi Relay Chat Systemd Start/Stop Scripts and Service File"
fi