moved mystic install to install script

This commit is contained in:
Mario Fetka 2024-04-20 11:20:06 +02:00
parent 2aadf552c4
commit 04c853871e
4 changed files with 51 additions and 9 deletions

View File

@ -1,4 +1,4 @@
CRYPT=$(whiptail --title "SSL SSH Support in Mystic" --radiolist --cancel-button Exit-Script "Choose Yes No" 8 58 2 \
CRYPT=$(whiptail --title "SSL SSH Support for Mystic" --radiolist --cancel-button Exit-Script "Choose Yes No" 8 58 2 \
"Yes" "Add ssl Support" ON \
"No" "Don't add ssl Support" OFF \
3>&1 1>&2 2>&3)

View File

@ -1,4 +1,4 @@
DBPSCRIPTS=$(whiptail --title "Add The Disconnected by Peer Support Script to Mystic" --radiolist --cancel-button Exit-Script "Choose Yes No" 8 58 2 \
DBPSCRIPTS=$(whiptail --title "Add The Disconnected by Peer Support Script" --radiolist --cancel-button Exit-Script "Choose Yes No" 8 58 2 \
"Yes" "Add DbP Script" ON \
"No" "Don't add DbP Script" OFF \
3>&1 1>&2 2>&3)

View File

@ -138,9 +138,7 @@ if [ "${DIST}" = "Ubuntu" ]; then
apt-add-repository -y multiverse &>/dev/null
fi
apt update &>/dev/null
apt install -y curl &>/dev/null
apt install -y wget &>/dev/null
apt install -y gnupg &>/dev/null
apt install -y curl wget gnupg unzip unrar &>/dev/null
mkdir -p $MSTEMPDIR &>/dev/null
msg_ok "Setting up ${APP} Repository"
@ -175,10 +173,13 @@ source $MSTEMPDIR/mystic/fail2ban/prompt-${SCRIPT_VER}.sh
# Add Fail2ban | banip
source $MSTEMPDIR/mystic/dosemu2/prompt-${SCRIPT_VER}.sh
exit 0
#==============================================================================================================
# Add Fail2ban | banip
source $MSTEMPDIR/mystic/mystic/install-${SCRIPT_VER}.sh
exit 0
msg_info "Starting ${APP} Installation !!!! Plz set Installation dir the same as bevor !!!"
apt install -y unrar-free python3 python2 libpython2.7 &>/dev/null
wget -N http://www.mysticbbs.com/downloads/mys${MYSTIC_VER}_${MYSTIC_ARCH}.${MYSTIC_EXT} -O $MSTEMPDIR/mys${MYSTIC_VER}_${MYSTIC_ARCH}.${MYSTIC_EXT} &>/dev/null

View File

@ -1,11 +1,52 @@
#!/bin/bash
msg_info "Starting ${APP} Installation !!!! Plz set Installation dir the same as bevor to ${MYSTIC_DIR}!!!"
read -n 1 -r -s -p $'Press enter to continue...\n'
apt install -y unrar-free python3 python2 libpython2.7 &>/dev/null
wget -N http://www.mysticbbs.com/downloads/mys${MYSTIC_VER}_${MYSTIC_ARCH}.${MYSTIC_EXT} -O $MSTEMPDIR/mys${MYSTIC_VER}_${MYSTIC_ARCH}.${MYSTIC_EXT} &>/dev/null
rm -rf $MSTEMPDIR/mystic-${MYSTIC_VER} &>/dev/null
mkdir -p $MSTEMPDIR/mystic-${MYSTIC_VER} &>/dev/null
pushd $MSTEMPDIR/mystic-${MYSTIC_VER} &>/dev/null
if [ "${MYSTIC_EXT}" = "rar" ]; then
unrar -x ../mys${MYSTIC_VER}_${MYSTIC_ARCH}.${MYSTIC_EXT} &>/dev/null
elif [ "${MYSTIC_EXT}" = "zip" ]; then
unzip ../mys${MYSTIC_VER}_${MYSTIC_ARCH}.${MYSTIC_EXT} &>/dev/null
else
exit 1
fi
chmod +x install &>/dev/null
./install
popd &>/dev/null
msg_ok "Finisched ${APP} Installation"
MYSTIC_DIR="$1"
msg_info "Creating ${APP} und setting Permissions in ${MYSTIC_DIR}"
if [ -z "${GROUP}" ]; then
groupadd mystic &>/dev/null
fi
if [ -z "${USER}" ]; then
useradd --home-dir ${MYSTIC_DIR} -g mystic mystic &>/dev/null
fi
chown mystic:mystic -R ${MYSTIC_DIR} &>/dev/null
find ${MYSTIC_DIR} -name '*.txt' -type f -exec dos2unix {} \; &>/dev/null
find ${MYSTIC_DIR} -name '*.ini' -type f -exec dos2unix {} \; &>/dev/null
find ${MYSTIC_DIR} -name '*.txt' -type f -exec chmod 0664 {} \; &>/dev/null
find ${MYSTIC_DIR} -name '*.ini' -type f -exec chmod 0664 {} \; &>/dev/null
find ${MYSTIC_DIR} -name '*.dat' -type f -exec chmod 0664 {} \; &>/dev/null
find ${MYSTIC_DIR} -name '*.ans' -type f -exec chmod 0664 {} \; &>/dev/null
find ${MYSTIC_DIR} -name '*.asc' -type f -exec chmod 0664 {} \; &>/dev/null
find ${MYSTIC_DIR} -name '*.hlp' -type f -exec chmod 0664 {} \; &>/dev/null
find ${MYSTIC_DIR} -name '*.mnu' -type f -exec chmod 0664 {} \; &>/dev/null
find ${MYSTIC_DIR} -name '*.mnu' -type f -exec chmod 0664 {} \; &>/dev/null
find ${MYSTIC_DIR} -name '*.mps' -type f -exec chmod 0664 {} \; &>/dev/null
find ${MYSTIC_DIR} -name '*.mpx' -type f -exec chmod 0664 {} \; &>/dev/null
find ${MYSTIC_DIR} -name '*.mpy' -type f -exec chmod 0664 {} \; &>/dev/null
find ${MYSTIC_DIR} -name '*.ms' -type f -exec chmod 0664 {} \; &>/dev/null
msg_ok "Creating ${APP} und setting Permissions in ${MYSTIC_DIR}"
msg_info "Installing ${APP} Systemd Start/Stop Scripts and Service File"
sed -e "s!@MYSTIC_DIR@!${MYSTIC_DIR}!g" mis-start.sh > ${MYSTIC_DIR}/mis-start
chmod +x ${MYSTIC_DIR}/mis-start
sed -e "s!@MYSTIC_DIR@!${MYSTIC_DIR}!g" mis-stop.sh > ${MYSTIC_DIR}/mis-stop
chmod +x ${MYSTIC_DIR}/mis-stop
sed -e "s!@MYSTIC_DIR@!${MYSTIC_DIR}!g" mis.service > /etc/systemd/system/mystic.service
systemctl daemon-reload
msg_ok "Installing ${APP} Systemd Start/Stop Scripts and Service File"