add initial install.sh script
This commit is contained in:
parent
6f96569360
commit
792c6c6f50
419
install.sh
Normal file
419
install.sh
Normal file
@ -0,0 +1,419 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
YW=$(echo "\033[33m")
|
||||||
|
BL=$(echo "\033[36m")
|
||||||
|
RD=$(echo "\033[01;31m")
|
||||||
|
BGN=$(echo "\033[4;92m")
|
||||||
|
GN=$(echo "\033[1;92m")
|
||||||
|
DGN=$(echo "\033[32m")
|
||||||
|
CL=$(echo "\033[m")
|
||||||
|
BFR="\\r\\033[K"
|
||||||
|
HOLD="-"
|
||||||
|
CM="${GN}✓${CL}"
|
||||||
|
APP="Mystic"
|
||||||
|
MSDIR="/opt/mystic"
|
||||||
|
TMP_DIR=$(mktemp -d)
|
||||||
|
ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH)
|
||||||
|
GROUP=$(getent group mystic)
|
||||||
|
USER=$(getent shadow mystic)
|
||||||
|
|
||||||
|
|
||||||
|
LIBDIR=/usr/lib/${ARCH}
|
||||||
|
MYSTIC_VER="112a47"
|
||||||
|
if [ "${ARCH}" = "x86_64-linux-gnu" ]; then
|
||||||
|
INIMOD_ARCH="64"
|
||||||
|
MYSTIC_ARCH="l64"
|
||||||
|
MYSTIC_EXT="rar"
|
||||||
|
elif [ "${ARCH}" = "i386-linux-gnu" ]; then
|
||||||
|
INIMOD_ARCH="32"
|
||||||
|
MYSTIC_ARCH="l32"
|
||||||
|
MYSTIC_EXT="rar"
|
||||||
|
elif [ "${ARCH}" = "arm-linux-gnueabihf" ]; then
|
||||||
|
INIMOD_ARCH="32"
|
||||||
|
MYSTIC_ARCH="p64"
|
||||||
|
MYSTIC_EXT="zip"
|
||||||
|
else
|
||||||
|
echo "Architecture not supported: ${ARCH}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
MRC_VER="129a"
|
||||||
|
|
||||||
|
hostname="$(hostname)"
|
||||||
|
set -o errexit
|
||||||
|
set -o errtrace
|
||||||
|
set -o nounset
|
||||||
|
set -o pipefail
|
||||||
|
shopt -s expand_aliases
|
||||||
|
alias die='EXIT=$? LINE=$LINENO error_exit'
|
||||||
|
trap die ERR
|
||||||
|
|
||||||
|
function error_exit() {
|
||||||
|
trap - ERR
|
||||||
|
local reason="Unknown failure occured."
|
||||||
|
local msg="${1:-$reason}"
|
||||||
|
local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
|
||||||
|
echo -e "$flag $msg" 1>&2
|
||||||
|
exit $EXIT
|
||||||
|
}
|
||||||
|
if command -v pveversion >/dev/null 2>&1; then echo -e "⚠️ Can't Install on Proxmox "; exit; fi
|
||||||
|
while true; do
|
||||||
|
read -p "This will Install ${APP} on $hostname. Proceed(y/n)?" yn
|
||||||
|
case $yn in
|
||||||
|
[Yy]*) break ;;
|
||||||
|
[Nn]*) exit ;;
|
||||||
|
*) echo "Please answer yes or no." ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
clear
|
||||||
|
function header_info {
|
||||||
|
echo -e "${BL}
|
||||||
|
__ __ _ _ ____ ____ _____
|
||||||
|
| \/ | | | (_) | _ \| _ \ / ____|
|
||||||
|
| \ / |_ _ ___| |_ _ ___ | |_) | |_) | (___
|
||||||
|
| |\/| | | | / __| __| |/ __| | _ <| _ < \___ \
|
||||||
|
| | | | |_| \__ \ |_| | (__ | |_) | |_) |____) |
|
||||||
|
|_| |_|\__, |___/\__|_|\___| |____/|____/|_____/
|
||||||
|
__/ |
|
||||||
|
_____ _ |___/ _____ _ _ _
|
||||||
|
| __ \| | | __ \ |_ _| | | | | |
|
||||||
|
| | | | |__ | |__) | | | _ __ ___| |_ __ _| | | ___ _ __
|
||||||
|
| | | | '_ \| ___/ | | | '_ \/ __| __/ _ | | |/ _ \ __|
|
||||||
|
| |__| | |_) | | _| |_| | | \__ \ || (_| | | | __/ |
|
||||||
|
|_____/|_ __/|_| |_____|_| |_|___/\__\__ _|_|_|\___|_|
|
||||||
|
|
||||||
|
${CL}"
|
||||||
|
}
|
||||||
|
|
||||||
|
header_info
|
||||||
|
function msg_info() {
|
||||||
|
local msg="$1"
|
||||||
|
echo -ne " ${HOLD} ${YW}${msg}..."
|
||||||
|
}
|
||||||
|
|
||||||
|
function msg_ok() {
|
||||||
|
local msg="$1"
|
||||||
|
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
|
||||||
|
}
|
||||||
|
|
||||||
|
msg_info "Setting up ${APP} Repository"
|
||||||
|
sed -i -e's/ main/ main contrib non-free/g' /etc/apt/sources.list &>/dev/null
|
||||||
|
apt-get update &>/dev/null
|
||||||
|
apt-get install -y curl &>/dev/null
|
||||||
|
apt-get install -y wget &>/dev/null
|
||||||
|
apt-get install -y gnupg &>/dev/null
|
||||||
|
mkdir -p /usr/local/src/mystic &>/dev/null
|
||||||
|
msg_ok "Setup ${APP} Repository"
|
||||||
|
|
||||||
|
#==============================================================================================================
|
||||||
|
|
||||||
|
MSAPPDIR=$(whiptail --inputbox "Mystic Install Directory that also must be set in the Mystic insallation Programm." 8 58 $MSDIR --title "Install Directory" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
|
||||||
|
exitstatus=$?
|
||||||
|
if [ -z $MSAPPDIR ]; then
|
||||||
|
MYSTIC_DIR="$MSDIR"
|
||||||
|
echo -e "${DGN}Installing Mystic to: ${BGN}$MYSTIC_DIR${CL}"
|
||||||
|
else
|
||||||
|
if [ $exitstatus = 0 ]; then
|
||||||
|
MYSTIC_DIR="$MSAPPDIR"
|
||||||
|
echo -e "${DGN}Installing Mystic to: ${BGN}$MYSTIC_DIR${CL}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
MUTIL_DIR=${MYSTIC_DIR}/mutil.d
|
||||||
|
|
||||||
|
CRYPT=$(whiptail --title "SSL SSH Support in 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)
|
||||||
|
exitstatus=$?
|
||||||
|
if [ $exitstatus = 0 ]; then
|
||||||
|
echo -e "${DGN}Add ssl Support: ${BGN}$CRYPT${CL}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
SPELL=$(whiptail --title "Spellcheck Support in Mystic" --radiolist --cancel-button Exit-Script "Choose Yes No" 8 58 2 \
|
||||||
|
"Yes" "Add Spellcheck Support" ON \
|
||||||
|
"No" "Don't add Spellcheck Support" OFF \
|
||||||
|
3>&1 1>&2 2>&3)
|
||||||
|
exitstatus=$?
|
||||||
|
if [ $exitstatus = 0 ]; then
|
||||||
|
echo -e "${DGN}Add Spellcheck Support: ${BGN}$SPELL${CL}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
MRC=$(whiptail --title "Multi Relay Chat Support in Mystic" --radiolist --cancel-button Exit-Script "Choose Yes No" 8 58 2 \
|
||||||
|
"Yes" "Add MrC Support" ON \
|
||||||
|
"No" "Don't add MrC Support" OFF \
|
||||||
|
3>&1 1>&2 2>&3)
|
||||||
|
exitstatus=$?
|
||||||
|
if [ $exitstatus = 0 ]; then
|
||||||
|
echo -e "${DGN}Add Multi Realy Chat Support: ${BGN}$MRC${CL}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
IP2L=$(whiptail --title "Add The IP2Location Download Client to Mystic" --radiolist --cancel-button Exit-Script "Choose Yes No" 8 58 2 \
|
||||||
|
"Yes" "Add IP2Location Download Client" ON \
|
||||||
|
"No" "Don't Add IP2Location™ Download Client" OFF \
|
||||||
|
3>&1 1>&2 2>&3)
|
||||||
|
exitstatus=$?
|
||||||
|
if [ $exitstatus = 0 ]; then
|
||||||
|
echo -e "${DGN}Add DbP Script: ${BGN}$IP2L${CL}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
DBPSCRIPTS=$(whiptail --title "Add The Disconnected by Peer Script to Mystic" --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)
|
||||||
|
exitstatus=$?
|
||||||
|
if [ $exitstatus = 0 ]; then
|
||||||
|
echo -e "${DGN}Add DbP Script: ${BGN}$DBPSCRIPTS${CL}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#==============================================================================================================
|
||||||
|
|
||||||
|
msg_info "Starting ${APP} Installation !!!! Plz set Installation dir the same as bevor !!!"
|
||||||
|
apt-get install -y unrar-free python3 python2 &>/dev/null
|
||||||
|
wget -N http://www.mysticbbs.com/downloads/mys${MYSTIC_VER}_${MYSTIC_ARCH}.${MYSTIC_EXT} -O /usr/local/src/mystic/mys${MYSTIC_VER}_${MYSTIC_ARCH}.${MYSTIC_EXT} &>/dev/null
|
||||||
|
rm -rf /usr/local/src/mystic/mystic-${MYSTIC_VER} &>/dev/null
|
||||||
|
mkdir -p /usr/local/src/mystic/mystic-${MYSTIC_VER} &>/dev/null
|
||||||
|
pushd /usr/local/src/mystic/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"
|
||||||
|
|
||||||
|
msg_info "Downloading ${APP} Systemd Start/Stop Scripts and Service File"
|
||||||
|
wget -N https://gitea.disconnected-by-peer.at/geos_one/mystic/archive/main.zip -O /usr/local/src/mystic/dbp-main.zip &>/dev/null
|
||||||
|
rm -rf /usr/local/src/mystic/mystic &>/dev/null
|
||||||
|
pushd /usr/local/src/mystic &>/dev/null
|
||||||
|
unzip dbp-main.zip &>/dev/null
|
||||||
|
popd &>/dev/null
|
||||||
|
msg_ok "Downloading ${APP} Systemd Start/Stop Scripts and Service File"
|
||||||
|
|
||||||
|
msg_info "Installing ${APP} Systemd Start/Stop Scripts and Service File"
|
||||||
|
pushd /usr/local/src/mystic/mystic/mis &>/dev/null
|
||||||
|
bash install.sh $MYSTIC_DIR &>/dev/null
|
||||||
|
popd &>/dev/null
|
||||||
|
msg_ok "Installing ${APP} Systemd Start/Stop Scripts and Service File"
|
||||||
|
|
||||||
|
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}"
|
||||||
|
|
||||||
|
#==============================================================================================================
|
||||||
|
|
||||||
|
if [ $SPELL = "Yes" ]; then
|
||||||
|
msg_info "Setting up Spellcheck for ${APP}"
|
||||||
|
apt-get install -y libhunspell-dev &>/dev/null
|
||||||
|
wget -N http://www.mysticbbs.com/downloads/mystic_spellcheck_v2.zip -O /usr/local/src/mystic/mystic_spellcheck_v2.zip &>/dev/null
|
||||||
|
rm -rf /usr/local/src/mystic/mystic_spellcheck_v2 &>/dev/null
|
||||||
|
mkdir -p /usr/local/src/mystic/mystic_spellcheck_v2 &>/dev/null
|
||||||
|
pushd /usr/local/src/mystic/mystic_spellcheck_v2 &>/dev/null
|
||||||
|
unzip ../mystic_spellcheck_v2.zip &>/dev/null
|
||||||
|
cp dictionary.* ${MYSTIC_DIR}/data/
|
||||||
|
cp wordlist.txt ${MYSTIC_DIR}/data/
|
||||||
|
cp README.txt ${MYSTIC_DIR}/docs/Spellcheck_README.txt
|
||||||
|
echo "; List secondary dicitinoaries in this File" > ${MYSTIC_DIR}/data/dictlist.txt
|
||||||
|
echo "; more details in the Spellcheck_README.txt" >> ${MYSTIC_DIR}/data/dictlist.txt
|
||||||
|
popd &>/dev/null
|
||||||
|
msg_ok "Setting up Spellcheck for ${APP}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
#==============================================================================================================
|
||||||
|
|
||||||
|
if [ $MRC = "Yes" ]; then
|
||||||
|
msg_info "Setting up Multi Relay Chat for ${APP}"
|
||||||
|
apt-get install -y build-essential &>/dev/null
|
||||||
|
wget -N https://www.phenomprod.com/releases/mystic/pn-mrc${MRC_VER}.zip -O /usr/local/src/mystic/pn-mrc${MRC_VER}.zip &>/dev/null
|
||||||
|
rm -rf /usr/local/src/mystic/pn-mrc${MRC_VER} &>/dev/null
|
||||||
|
mkdir -p /usr/local/src/mystic/pn-mrc${MRC_VER} &>/dev/null
|
||||||
|
pushd /usr/local/src/mystic/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
|
||||||
|
msg_ok "Setting up Multi Relay Chat for ${APP}"
|
||||||
|
|
||||||
|
msg_info "Installing Multi Relay Chat Systemd Start/Stop Scripts and Service File"
|
||||||
|
pushd /usr/local/src/mystic/mystic/mrc &>/dev/null
|
||||||
|
bash install.sh $MYSTIC_DIR &>/dev/null
|
||||||
|
popd &>/dev/null
|
||||||
|
msg_ok "Installing Multi Relay Chat Systemd Start/Stop Scripts and Service File"
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
#==============================================================================================================
|
||||||
|
|
||||||
|
if [ $CRYPT = "Yes" ]; then
|
||||||
|
msg_info "Setting up ${APP} cryptlib for ssh/ssl (be patient compiling cryptlib)"
|
||||||
|
apt-get install -y build-essential &>/dev/null
|
||||||
|
apt-get install -y patch &>/dev/null
|
||||||
|
apt-get install -y dos2unix &>/dev/null
|
||||||
|
wget -N http://www.mysticbbs.com/downloads/cl3431.zip -O /usr/local/src/mystic/cryptlib3431.zip &>/dev/null
|
||||||
|
rm -rf /usr/local/src/mystic/cryptlib-3.4.3.1 &>/dev/null
|
||||||
|
mkdir -p /usr/local/src/mystic/cryptlib-3.4.3.1 &>/dev/null
|
||||||
|
pushd /usr/local/src/mystic/cryptlib-3.4.3.1 &>/dev/null
|
||||||
|
unzip ../cryptlib3431.zip &>/dev/null
|
||||||
|
dos2unix tools/* &>/dev/null
|
||||||
|
patch -p1 -i /usr/local/src/mystic/mystic/cryptlib/gccversion-3431.patch &>/dev/null
|
||||||
|
make shared &>/dev/null
|
||||||
|
cp libcl.so.3.4.3 ${LIBDIR}/ &>/dev/null
|
||||||
|
ln -sf libcl.so.3.4.3 ${LIBDIR}/libcl.so.3.4 &>/dev/null
|
||||||
|
ln -sf libcl.so.3.4 ${LIBDIR}/libcl.so.3 &>/dev/null
|
||||||
|
ln -sf libcl.so.3 ${LIBDIR}/libcl.so &>/dev/null
|
||||||
|
popd &>/dev/null
|
||||||
|
msg_ok "Setting up ${APP} cryptlib for ssh/ssl (be patient compiling cryptlib)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
#==============================================================================================================
|
||||||
|
|
||||||
|
if [ $IP2L = "Yes" ]; then
|
||||||
|
msg_info "Setting up IP2Location Download Client for ${APP}"
|
||||||
|
apt-get install -y libwww-perl &>/dev/null
|
||||||
|
wget -N https://www.ip2location.com/downloads/ip2location-downloader-linux.zip -O /usr/local/src/mystic/ip2location-downloader-linux.zip &>/dev/null
|
||||||
|
rm -rf /usr/local/src/mystic/ip2location-downloader-linux &>/dev/null
|
||||||
|
mkdir -p /usr/local/src/mystic/ip2location-downloader-linux &>/dev/null
|
||||||
|
pushd /usr/local/src/mystic/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://www.pazera-software.com/files/IniMod_linux${INIMOD_ARCH}.zip -O /usr/local/src/mystic/IniMod_linux${INIMOD_ARCH}.zip &>/dev/null
|
||||||
|
rm -rf /usr/local/src/mystic/IniMod_linux${INIMOD_ARCH} &>/dev/null
|
||||||
|
mkdir -p /usr/local/src/mystic/IniMod_linux${INIMOD_ARCH} &>/dev/null
|
||||||
|
pushd /usr/local/src/mystic/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 /usr/local/src/mystic/mystic/dbp &>/dev/null
|
||||||
|
bash install.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
|
||||||
|
sed -e "s!c:/mystic!${MYSTIC_DIR}!g" -i ${MYSTIC_DIR}/mutil.ini
|
||||||
|
sed -e "s!d:/mystic!${MYSTIC_DIR}!g" -i ${MYSTIC_DIR}/mutil.ini
|
||||||
|
sed -e "s!d:/nodelist!${MYSTIC_DIR}/files/nodelist!g" -i ${MYSTIC_DIR}/mutil.ini
|
||||||
|
sed -e 's/\\/\//g' -i ${MYSTIC_DIR}/mide.ini
|
||||||
|
sed -e "s!c:/mystic!${MYSTIC_DIR}!g" -i ${MYSTIC_DIR}/mide.ini
|
||||||
|
|
||||||
|
mkdir -p ${MYSTIC_DIR}/mutil.d
|
||||||
|
cat ${MYSTIC_DIR}/mutil.ini | sed '/\[General\]/q' | sed '$d' > ${MUTIL_DIR}/README.txt
|
||||||
|
cat ${MYSTIC_DIR}/mutil.ini | sed -n '/\[General\]/, /\[/p' | sed '$d' > ${MUTIL_DIR}/General
|
||||||
|
cat ${MYSTIC_DIR}/mutil.ini | sed -n '/\[Import_FIDONET\.NA\]/, /\[/p' | sed '$d' > ${MUTIL_DIR}/Import_FIDONET.NA
|
||||||
|
configarray=('Import_FIDONET.NA')
|
||||||
|
cat ${MYSTIC_DIR}/mutil.ini | sed -n '/\[Import_FILEBONE\.NA\]/, /\[/p' | sed '$d' > ${MUTIL_DIR}/Import_FILEBONE.NA
|
||||||
|
configarray+=('Import_FILEBONE.NA')
|
||||||
|
cat ${MYSTIC_DIR}/mutil.ini | sed -n '/\[Export_FILEBONE\.NA\]/, /\[/p' | sed '$d' > ${MUTIL_DIR}/Export_FILEBONE.NA
|
||||||
|
configarray+=('Export_FILEBONE.NA')
|
||||||
|
cat ${MYSTIC_DIR}/mutil.ini | sed -n '/\[Export_AREAS\.BBS\]/, /\[/p' | sed '$d' > ${MUTIL_DIR}/Export_AREAS.BBS
|
||||||
|
configarray+=('Export_AREAS.BBS')
|
||||||
|
cat ${MYSTIC_DIR}/mutil.ini | sed -n '/\[Export_GOLDED\]/, /\[/p' | sed '$d' > ${MUTIL_DIR}/Export_GOLDED
|
||||||
|
configarray+=('Export_GOLDED')
|
||||||
|
cat ${MYSTIC_DIR}/mutil.ini | sed -n '/\[Import_FILES\.BBS\]/, /\[/p' | sed '$d' > ${MUTIL_DIR}/Import_FILES.BBS
|
||||||
|
configarray+=('Import_FILES.BBS')
|
||||||
|
cat ${MYSTIC_DIR}/mutil.ini | sed -n '/\[MassUpload\]/, /\[/p' | sed '$d' > ${MUTIL_DIR}/MassUpload
|
||||||
|
configarray+=('MassUpload')
|
||||||
|
cat ${MYSTIC_DIR}/mutil.ini | sed -n '/\[GenerateTopLists\]/, /\[/p' | sed '$d' > ${MUTIL_DIR}/GenerateTopLists
|
||||||
|
configarray+=('GenerateTopLists')
|
||||||
|
cat ${MYSTIC_DIR}/mutil.ini | sed -n '/\[GenerateAllFiles\]/, /\[/p' | sed '$d' > ${MUTIL_DIR}/GenerateAllFiles
|
||||||
|
configarray+=('GenerateAllFiles')
|
||||||
|
cat ${MYSTIC_DIR}/mutil.ini | sed -n '/\[PurgeMessageBases\]/, /\[/p' | sed '$d' > ${MUTIL_DIR}/PurgeMessageBases
|
||||||
|
configarray+=('PurgeMessageBases')
|
||||||
|
cat ${MYSTIC_DIR}/mutil.ini | sed -n '/\[PackMessageBases\]/, /\[/p' | sed '$d' > ${MUTIL_DIR}/PackMessageBases
|
||||||
|
configarray+=('PackMessageBases')
|
||||||
|
cat ${MYSTIC_DIR}/mutil.ini | sed -n '/\[PostTextFiles\]/, /\[/p' | sed '$d' > ${MUTIL_DIR}/PostTextFiles
|
||||||
|
configarray+=('PostTextFiles')
|
||||||
|
cat ${MYSTIC_DIR}/mutil.ini | sed -n '/\[Import_MessageBase\]/, /\[/p' | sed '$d' > ${MUTIL_DIR}/Import_MessageBase
|
||||||
|
configarray+=('Import_MessageBase')
|
||||||
|
cat ${MYSTIC_DIR}/mutil.ini | sed -n '/\[ImportEchoMail\]/, /\[/p' | sed '$d' > ${MUTIL_DIR}/ImportEchoMail
|
||||||
|
configarray+=('ImportEchoMail')
|
||||||
|
cat ${MYSTIC_DIR}/mutil.ini | sed -n '/\[ExportEchoMail\]/, /\[/p' | sed '$d' > ${MUTIL_DIR}/ExportEchoMail
|
||||||
|
configarray+=('ExportEchoMail')
|
||||||
|
cat ${MYSTIC_DIR}/mutil.ini | sed -n '/\[MergeNodeLists\]/, /\[/p' | sed '$d' > ${MUTIL_DIR}/MergeNodeLists
|
||||||
|
configarray+=('MergeNodeLists')
|
||||||
|
cat ${MYSTIC_DIR}/mutil.ini | sed -n '/\[FileToss\]/, /\[/p' | sed '$d' > ${MUTIL_DIR}/FileToss
|
||||||
|
configarray+=('FileToss')
|
||||||
|
cat ${MYSTIC_DIR}/mutil.ini | sed -n '/\[PackFileBases\]/, /\[/p' | sed '$d' > ${MUTIL_DIR}/PackFileBases
|
||||||
|
configarray+=('PackFileBases')
|
||||||
|
cat ${MYSTIC_DIR}/mutil.ini | sed -n '/\[LinkMessages\]/, /\[/p' | sed '$d' > ${MUTIL_DIR}/LinkMessages
|
||||||
|
configarray+=('LinkMessages')
|
||||||
|
cat ${MYSTIC_DIR}/mutil.ini | sed -n '/\[PurgeUserBase\]/, /\[/p' | sed '$d' > ${MUTIL_DIR}/PurgeUserBase
|
||||||
|
configarray+=('PurgeUserBase')
|
||||||
|
cat ${MYSTIC_DIR}/mutil.ini | sed -n '/\[PackUserBase\]/, /\[/p' | sed '$d' > ${MUTIL_DIR}/PackUserBase
|
||||||
|
configarray+=('PackUserBase')
|
||||||
|
cat ${MYSTIC_DIR}/mutil.ini | sed -n '/\[FileSort\]/, /\[/p' | sed '$d' > ${MUTIL_DIR}/FileSort
|
||||||
|
configarray+=('FileSort')
|
||||||
|
cat ${MYSTIC_DIR}/mutil.ini | sed -n '/\[AutoHatch\]/, /\[/p' | sed '$d' > ${MUTIL_DIR}/AutoHatch
|
||||||
|
configarray+=('AutoHatch')
|
||||||
|
cat ${MYSTIC_DIR}/mutil.ini | sed -n '/\[EchoNodeTracker\]/, $p' | sed '$d' > ${MUTIL_DIR}/EchoNodeTracker
|
||||||
|
configarray+=('EchoNodeTracker')
|
||||||
|
|
||||||
|
pushd ${MUTIL_DIR} &>/dev/null
|
||||||
|
#=====================================================================================#
|
||||||
|
|
||||||
|
configfile="maint.ini"
|
||||||
|
config=('PurgeMessageBases' 'PackMessageBases' 'MergeNodeLists' 'PackFileBases' 'PurgeUserBase' 'PackUserBase' 'FileSort')
|
||||||
|
preparray=("${configarray[@]}")
|
||||||
|
for el in ${config[@]}
|
||||||
|
do
|
||||||
|
preparray=("${preparray[@]/$el}")
|
||||||
|
done
|
||||||
|
|
||||||
|
cat General ${config[@]} > ${MYSTIC_DIR}/${configfile}
|
||||||
|
for el in ${preparray[@]}
|
||||||
|
do
|
||||||
|
sed -e "/$el/d" -i ${MYSTIC_DIR}/${configfile}
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
#=====================================================================================#
|
||||||
|
|
||||||
|
chown mystic:mystic -R ${MYSTIC_DIR} &>/dev/null
|
||||||
|
popd &>/dev/null
|
||||||
|
|
||||||
|
msg_ok "Completed Successfully!\n"
|
Loading…
Reference in New Issue
Block a user