add finale installer parts

This commit is contained in:
Mario Fetka 2024-04-20 14:18:20 +02:00
parent 0ff0fdc74b
commit 97289025bf
4 changed files with 64 additions and 129 deletions

View File

@ -7,6 +7,7 @@ ErrorLog=false
NodeLog=false
MutilLog=false
MrcChatLog=false
MrcServerLog=false
BanUnbanIP=false
BaseDir=@MYSTIC_DIR@

View File

@ -0,0 +1,12 @@
if [ $DOSEMU = "Yes" ]; then
msg_info "Installing DosEmu2 Dependencies for ${APP}"
pushd $MSTEMPDIR &>/dev/null
curl 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x6d9cd73b401a130336ed0a56ebe1b5ded2ad45d6' | tee /etc/apt/trusted.gpg.d/code.launchpad.net-dosemu2.asc &>/dev/null
echo "deb https://ppa.launchpadcontent.net/dosemu2/ppa/ubuntu $UBUNTU main" | tee /etc/apt/sources.list.d/dosemu2.list &>/dev/null
apt update &>/dev/null
apt install -y dosemu2 &>/dev/null
apt install -y install-otherdos &>/dev/null
msg_ok "Installing DosEmu2 Dependencies for ${APP}"
fi

View File

@ -1,13 +1,53 @@
#!/bin/bash
MYSTIC_DIR="$1"
if [ $BANUNBAN = "fail2ban" ]; then
msg_info "Installing Fail2Ban Dependencies for ${APP}"
apt install -y fail2ban &>/dev/null
apt install -y iptables &>/dev/null
apt install -y ipset &>/dev/null
if [ -z "${FAIL2BAN_GROUP}" ]; then
groupadd fail2ban &>/dev/null
fi
usermod --append --groups fail2ban mystic &>/dev/null
msg_ok "Installing Fail2Ban Dependencies for ${APP}"
msg_info "Installing Fail2Ban Scripts for ${APP}"
pushd $MSTEMPDIR/mystic/fail2ban &>/dev/null
sed -e "s!@MYSTIC_DIR@!${MYSTIC_DIR}!g" action.d/mysticbbs.conf > /etc/fail2ban/action.d/mysticbbs.conf
sed -e "s!@MYSTIC_DIR@!${MYSTIC_DIR}!g" filter.d/mysticbbs.conf > /etc/fail2ban/filter.d/mysticbbs.conf
sed -e "s!@MYSTIC_DIR@!${MYSTIC_DIR}!g" jail.d/mysticbbs.conf > /etc/fail2ban/jail.d/mysticbbs.conf
mkdir -p /etc/systemd/system/fail2ban.service.d
cp systemd/override.conf /etc/systemd/system/fail2ban.service.d/override.conf
popd &>/dev/null
msg_ok "Installing Fail2Ban Scripts for ${APP}"
fi
if [ $BANUNBAN = "ipban" ]; then
msg_info "Installing IpBan Dependencies for ${APP}"
pushd $MSTEMPDIR &>/dev/null
wget -N https://github.com/DigitalRuby/IPBan/raw/master/IPBanCore/Linux/Scripts/Install.sh -O $MSTEMPDIR/ipban-install.sh &>/dev/null
apt install -y fail2ban &>/dev/null
apt install -y iptables &>/dev/null
apt install -y ipset &>/dev/null
apt install -y xmlstarlet &>/dev/null
sed -i '/yum/d' $MSTEMPDIR/ipban-install.sh &>/dev/null
sed -i '/systemctl/d' $MSTEMPDIR/ipban-install.sh &>/dev/null
sed -e 's!sudo !!g' -i $MSTEMPDIR/ipban-install.sh &>/dev/null
sed -e 's!-qq!-qqo!g' -i $MSTEMPDIR/ipban-install.sh &>/dev/null
sed -i '/nano/d' $MSTEMPDIR/ipban-install.sh &>/dev/null
bash $MSTEMPDIR/ipban-install.sh &>/dev/null
if [ -z "${IPBAN_GROUP}" ]; then
groupadd ipban &>/dev/null
fi
usermod --append --groups ipban mystic &>/dev/null
chown -R root:ipban /opt/ipban &>/dev/null
chmod 775 /opt/ipban/ &>/dev/null
dos2unix /opt/ipban/*.{config,xml,md} &>/dev/null
popd &>/dev/null
msg_ok "Installing IpBan Dependencies for ${APP}"
fi

View File

@ -9,7 +9,7 @@ CL=$(echo "\033[m")
BFR="\\r\\033[K"
HOLD="-"
CM="${GN}${CL}"
APP="Mystic Installer"
APP="Mystic BBS"
MSDIR="/opt/mystic"
MSTEMPDIR="/usr/local/src/mystic"
TMP_DIR=$(mktemp -d)
@ -176,7 +176,6 @@ source $MSTEMPDIR/mystic/dosemu2/prompt-${SCRIPT_VER}.sh
#==============================================================================================================
# Mystic install
source $MSTEMPDIR/mystic/mystic/install-${SCRIPT_VER}.sh
# Add Spellcheck
@ -191,130 +190,13 @@ source $MSTEMPDIR/mystic/cryptlib/install-${SCRIPT_VER}.sh
source $MSTEMPDIR/mystic/ip2location/install-${SCRIPT_VER}.sh
# Add DBP Scripts
source $MSTEMPDIR/mystic/dbp/install-${SCRIPT_VER}.sh
# Add Fail2ban | banip
source $MSTEMPDIR/mystic/fail2ban/install-${SCRIPT_VER}.sh
# Add Fail2ban | banip
source $MSTEMPDIR/mystic/dosemu2/install-${SCRIPT_VER}.sh
exit 0
if [ $IP2L = "Yes" ]; then
msg_info "Setting up IP2Location Download Client for ${APP}"
apt install -y libwww-perl &>/dev/null
wget -N https://www.ip2location.com/downloads/ip2location-downloader-linux.zip -O $MSTEMPDIR/ip2location-downloader-linux.zip &>/dev/null
rm -rf $MSTEMPDIR/ip2location-downloader-linux &>/dev/null
mkdir -p $MSTEMPDIR/ip2location-downloader-linux &>/dev/null
pushd $MSTEMPDIR/ip2location-downloader-linux &>/dev/null
unzip ../ip2location-downloader-linux.zip &>/dev/null
cp download.pl ${MYSTIC_DIR}/ip2location
chmod +x ${MYSTIC_DIR}/ip2location
cp readme.txt ${MYSTIC_DIR}/docs/ip2location_README.txt
popd &>/dev/null
msg_ok "Setting up IP2Location Download Client for ${APP}"
fi
#==============================================================================================================
if [ $DBPSCRIPTS = "Yes" ]; then
msg_info "Installing bbs.disconnected-by-peer.at Scripts Dependencies for ${APP}"
wget -N https://ftp.disconnected-by-peer.at/IniMod/IniMod_linux_${INIMOD_ARCH}.zip -O $MSTEMPDIR/IniMod_linux_${INIMOD_ARCH}.zip &>/dev/null
rm -rf $MSTEMPDIR/IniMod_linux_${INIMOD_ARCH} &>/dev/null
mkdir -p $MSTEMPDIR/IniMod_linux_${INIMOD_ARCH} &>/dev/null
pushd $MSTEMPDIR/IniMod_linux_${INIMOD_ARCH} &>/dev/null
unzip ../IniMod_linux_${INIMOD_ARCH}.zip &>/dev/null
cp inimod ${MYSTIC_DIR}
chmod +x ${MYSTIC_DIR}/inimod
cp README.txt ${MYSTIC_DIR}/docs/inimod_README.txt
popd &>/dev/null
msg_ok "Installing bbs.disconnected-by-peer.at Scripts Dependencies for ${APP}"
msg_info "Installing DbP Cron/banip/unbanip Scripts"
pushd $MSTEMPDIR/mystic/dbp &>/dev/null
bash install-${SCRIPT_VER}.sh $MYSTIC_DIR &>/dev/null
popd &>/dev/null
msg_ok "Installing DbP Cron/banip/unbanip Scripts"
fi
#==============================================================================================================
if [ $BANUNBAN = "fail2ban" ]; then
msg_info "Installing Fail2Ban Dependencies for ${APP}"
apt install -y fail2ban &>/dev/null
apt install -y iptables &>/dev/null
apt install -y ipset &>/dev/null
if [ -z "${FAIL2BAN_GROUP}" ]; then
groupadd fail2ban &>/dev/null
fi
usermod --append --groups fail2ban mystic &>/dev/null
msg_ok "Installing Fail2Ban Dependencies for ${APP}"
msg_info "Installing Fail2Ban Scripts for ${APP}"
pushd $MSTEMPDIR/mystic/fail2ban &>/dev/null
bash install-${SCRIPT_VER}.sh $MYSTIC_DIR &>/dev/null
popd &>/dev/null
msg_ok "Installing Fail2Ban Scripts for ${APP}"
fi
if [ $BANUNBAN = "ipban" ]; then
msg_info "Installing IpBan Dependencies for ${APP}"
pushd $MSTEMPDIR &>/dev/null
wget -N https://github.com/DigitalRuby/IPBan/raw/master/IPBanCore/Linux/Scripts/Install.sh -O $MSTEMPDIR/ipban-install.sh &>/dev/null
apt install -y fail2ban &>/dev/null
apt install -y iptables &>/dev/null
apt install -y ipset &>/dev/null
apt install -y xmlstarlet &>/dev/null
sed -i '/yum/d' $MSTEMPDIR/ipban-install.sh &>/dev/null
sed -i '/systemctl/d' $MSTEMPDIR/ipban-install.sh &>/dev/null
sed -e 's!sudo !!g' -i $MSTEMPDIR/ipban-install.sh &>/dev/null
sed -e 's!-qq!-qqo!g' -i $MSTEMPDIR/ipban-install.sh &>/dev/null
sed -i '/nano/d' $MSTEMPDIR/ipban-install.sh &>/dev/null
bash $MSTEMPDIR/ipban-install.sh &>/dev/null
if [ -z "${IPBAN_GROUP}" ]; then
groupadd ipban &>/dev/null
fi
usermod --append --groups ipban mystic &>/dev/null
chown -R root:ipban /opt/ipban &>/dev/null
chmod 775 /opt/ipban/ &>/dev/null
dos2unix /opt/ipban/*.{config,xml,md} &>/dev/null
popd &>/dev/null
msg_ok "Installing IpBan Dependencies for ${APP}"
#msg_info "Installing Fail2Ban Scripts for ${APP}"
#pushd $MSTEMPDIR/mystic/ipban &>/dev/null
#bash install-${SCRIPT_VER}.sh $MYSTIC_DIR &>/dev/null
#popd &>/dev/null
#msg_ok "Installing Fail2Ban Scripts for ${APP}"
fi
#==============================================================================================================
if [ $DOSEMU = "Yes" ]; then
msg_info "Installing DosEmu2 Dependencies for ${APP}"
pushd $MSTEMPDIR &>/dev/null
curl 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x6d9cd73b401a130336ed0a56ebe1b5ded2ad45d6' | tee /etc/apt/trusted.gpg.d/code.launchpad.net-dosemu2.asc &>/dev/null
echo "deb https://ppa.launchpadcontent.net/dosemu2/ppa/ubuntu $UBUNTU main" | tee /etc/apt/sources.list.d/dosemu2.list &>/dev/null
apt update &>/dev/null
apt install -y dosemu2 &>/dev/null
apt install -y install-otherdos &>/dev/null
#rm -rf $MSTEMPDIR/IniMod_linux${INIMOD_ARCH} &>/dev/null
#mkdir -p $MSTEMPDIR/IniMod_linux${INIMOD_ARCH} &>/dev/null
#pushd $MSTEMPDIR/IniMod_linux${INIMOD_ARCH} &>/dev/null
#unzip ../IniMod_linux${INIMOD_ARCH}.zip &>/dev/null
#cp inimod ${MYSTIC_DIR}
#chmod +x ${MYSTIC_DIR}/inimod
#cp README.txt ${MYSTIC_DIR}/docs/inimod_README.txt
#popd &>/dev/null
msg_ok "Installing DosEmu2 Dependencies for ${APP}"
#msg_info "Installing DbP Cron/banip/unbanip Scripts"
#pushd $MSTEMPDIR/mystic/dbp &>/dev/null
#bash install-${SCRIPT_VER}.sh $MYSTIC_DIR &>/dev/null
#popd &>/dev/null
#msg_ok "Installing DbP Cron/banip/unbanip Scripts"
fi
#==============================================================================================================
sed -e 's/\\/\//g' -i ${MYSTIC_DIR}/mutil.ini