Updated scripts to v5

This commit is contained in:
Toastie 2024-06-25 22:22:09 +12:00
parent ff77b869fb
commit e318f29bbf
Signed by: toastie_t0ast
GPG key ID: 27F3B6855AFD40A4
6 changed files with 94 additions and 208 deletions

View file

@ -10,7 +10,7 @@ then
echo "Dotnet is installed."
echo ""
else
echo "Dotnet is not installed. Please install preqrequisites (option 1)."
echo "Dotnet is not installed. Please install prerequisites (option 1)."
exit 1
fi
@ -25,11 +25,15 @@ fi
while [ $choice -eq 4 ]; do
read choice
if [ $choice -eq 1 ] ; then
wget -q -N https://toastielab.dev/Emotions-stuff/ellie-bash-installer/raw/branch/v5/detectOS.sh
bash detectOS.sh > /dev/null || exit $?
echo ""
echo "Running EllieBot with auto update. Please wait. . ."
while :; do
yt-dlp -U 2>/dev/null
cd "$root/elliebot"
cd "$root/elliebot"
git fetch
HEADHASH=$(git rev-parse HEAD)
UPSTREAMHASH=$(git rev-parse @{u})
@ -37,7 +41,7 @@ read choice
if [[ "$HEADHASH" != "$UPSTREAMHASH" ]]; then
echo "Update found, this may take a few minutes... "
cd $root
wget -N https://toastielab.dev/Emotions-stuff/ellie-bash-installer/raw/branch/v4/e-download.sh && bash "$root/e-download.sh"
wget -N https://toastielab.dev/Emotions-stuff/ellie-bash-installer/raw/branch/v5/e-download.sh && bash "$root/e-download.sh"
cd elliebot/output
dotnet EllieBot.dll
else

View file

@ -2,13 +2,21 @@
root=$(pwd)
wget -q -N https://toastielab.dev/Emotions-stuff/ellie-bash-installer/raw/branch/v5/detectOS.sh
bash detectOS.sh > /dev/null || exit $?
# remove old backup but store the database
if [ -d elliebot_old/output/data/ ]; then
if [ -f elliebot_old/output/data/NadekoBot.db ]; then
if [ -f elliebot_old/output/data/EllieBot.db ]; then
if [ ! -d elliebot_db_backups/ ]; then
mkdir elliebot_db_backups
fi
cp elliebot_old/output/data/NadekoBot.db elliebot_db_backups/NadekoBot-$(date +%s).db
date_now=$(date +%s)
cp elliebot_old/output/data/EllieBot.db elliebot_db_backups/EllieBot-"$date_now".db
if [ -f elliebot_old/output/creds.yml ]; then
cp elliebot_old/output/creds.yml elliebot_db_backups/creds-"$date_now".yml
fi
fi
fi
rm -rf elliebot_old 1>/dev/null 2>&1
@ -17,9 +25,9 @@ rm -rf elliebot_old 1>/dev/null 2>&1
mv -fT elliebot elliebot_old 1>/dev/null 2>&1
# clone new version
git clone -b v4 --recursive --depth 1 https://toastielab.dev/Emotions-stuff/elliebot
git clone -b v5 --recursive --depth 1 https://toastielab.dev/Emotions-stuff/elliebot
wget -q -N https://toastielab.dev/Emotions-stuff/ellie-bash-installer/raw/branch/v4/rebuild.sh
wget -q -N https://toastielab.dev/Emotions-stuff/ellie-bash-installer/raw/branch/v5/rebuild.sh
bash rebuild.sh
cd "$root"

View file

@ -6,7 +6,7 @@ echo ""
root=$(pwd)
choice=9
base_url="https://toastielab.dev/Emotions-stuff/ellie-bash-installer/raw/branch/v4"
base_url="https://toastielab.dev/Emotions-stuff/ellie-bash-installer/raw/branch/v5"
script_menu="e-menu.sh"
script_prereq="e-prereq.sh"

View file

@ -3,113 +3,20 @@
root=$(pwd)
echo ""
function detect_OS_ARCH_VER_BITS {
ARCH=$(uname -m | sed 's/x86_//;s/i[3-6]86/32/')
if [ -f /etc/lsb-release ]; then
. /etc/lsb-release
fi
if ! [ "$DISTRIB_ID" = "" ]; then
OS=$DISTRIB_ID
VER=$DISTRIB_RELEASE
elif [ -f /etc/debian_version ]; then
OS=Debian # XXX or Ubuntu??
VER=$(cat /etc/debian_version)
SVER=$( grep -oP "[0-9]+" /etc/debian_version | head -1 )
elif [ -f /etc/centos-release ]; then
OS=CentOS
VER=$( grep -oP "[0-9]+" /etc/centos-release | head -1 )
elif [ -f /etc/fedora-release ]; then
OS=Fedora
VER=$( grep -oP "[0-9]+" /etc/fedora-release | head -1 )
elif [ -f /etc/os-release ]; then
. /etc/os-release
if [ "$NAME" = "" ]; then
OS=$(uname -s)
VER=$(uname -r)
else
OS=$NAME
VER=$VERSION_ID
fi
else
OS=$(uname -s)
VER=$(uname -r)
fi
case $(uname -m) in
x86_64)
BITS=64
;;
i*86)
BITS=32
;;
armv*)
BITS=32
;;
*)
BITS=?
;;
esac
case $(uname -m) in
x86_64)
ARCH=x64 # or AMD64 or Intel64 or whatever
;;
i*86)
ARCH=x86 # or IA32 or Intel32 or whatever
;;
*)
# leave ARCH as-is
;;
esac
function INSTALL_YTDLP {
sudo wget https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -O /usr/local/bin/yt-dlp
sudo chmod a+rx /usr/local/bin/yt-dlp
}
declare OS ARCH VER BITS
wget -q -N https://toastielab.dev/Emotions-stuff/ellie-bash-installer/raw/branch/v5/detectOS.sh
declare DETECTED=($(bash detectOS.sh))
detect_OS_ARCH_VER_BITS
if [[ ${DETECTED[0]} = "" ]]; then exit 1; fi
export OS ARCH VER BITS
if [ "$BITS" = 32 ]; then
echo -e "Your system architecture is $ARCH which is unsupported to run Microsoft .NET Core SDK. \nYour OS: $OS \nOS Version: $VER"
echo
printf "\e[1;31mPlease check the EllieBot self-hosting guide for alternatives.\e[0m\n"
rm e-prereq.sh
exit 1
fi
if [ "$OS" = "Ubuntu" ]; then
supported_ver=("16.04" "18.04" "20.04" "21.04" "21.10" "22.04")
if [[ "${supported_ver[*]}" =~ ${VER} ]]; then
supported=1
else
supported=0
fi
fi
if [ "$OS" = "LinuxMint" ]; then
SVER=$( echo $VER | grep -oP "[0-9]+" | head -1 )
supported_ver=("19" "20")
if [[ "${supported_ver[*]}" =~ ${SVER} ]]; then
supported=1
else
supported=0
fi
fi
if [ "$supported" = 0 ]; then
echo -e "Your OS $OS $VER $ARCH looks unsupported to run Microsoft .NET Core. \nExiting..."
printf "\e[1;31mContact EllieBot's support on Discord with screenshot.\e[0m\n"
rm e-prereq.sh
exit 1
fi
if [ "$OS" = "Linux" ]; then
echo -e "Your OS $OS $VER $ARCH probably can run Microsoft .NET Core. \nContact EllieBot's support on Discord with screenshot."
rm e-prereq.sh
exit 1
fi
OS="${DETECTED[0]}"
VER="${DETECTED[1]}"
ARCH="${DETECTED[2]}"
SVER="${DETECTED[3]}"
echo "This installer will download all of the required packages for EllieBot. It will use about 350MB of space. This might take awhile to download if you do not have a good internet connection.\n"
echo -e "Would you like to continue? \nYour OS: $OS \nOS Version: $VER \nArchitecture: $ARCH"
@ -126,8 +33,8 @@ done
echo ""
if [ "$OS" = "Ubuntu" ]; then
if [ "$VER" = "21.04" ]; then
echo -e "*Ubuntu 21.04 has reached an End Of Life (EOL) on January 20, 2022. For more information, see the official Ubuntu EOL page. For now, .NET 6 will be supported but it is advised you upgrade to another version."
if [ "$VER" = "23.10" ]; then
echo -e "*Ubuntu 23.10 will reach End Of Life (EOL) on July 01, 2024. For more information, see the official Ubuntu EOL page. "
fi
echo "Installing dotnet"
wget "https://packages.microsoft.com/config/ubuntu/$VER/packages-microsoft-prod.deb" -O packages-microsoft-prod.deb
@ -138,63 +45,52 @@ if [ "$OS" = "Ubuntu" ]; then
sudo apt-get install -y apt-transport-https && sudo apt-get update;
sudo apt-get install -y dotnet-sdk-8.0;
echo "Installing Git, Redis and Tmux..."
sudo apt-get install git tmux redis-server -y
echo "Installing Git and Tmux..."
sudo apt-get install git tmux -y
echo "Installing music prerequisites..."
sudo apt-get install libopus0 opus-tools libopus-dev libsodium-dev -y
sudo apt install python
sudo apt-get install libopus0 opus-tools libopus-dev libsodium-dev python ffmpeg -y
echo ""
sudo apt-get install ffmpeg
sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl
INSTALL_YTDLP
elif [ "$OS" = "Debian" ]; then
if [[ "$SVER" == "9" ]]; then
echo "Support for Debian 9 has reached End of Life (EOL) as of August 9, 2022"
echo "Please upgrade to Debian 10 or newer"
rm e-prereq.sh
exit 1
elif [[ "$SVER" == "10" ]]; then
su -
apt-get install sudo -y
wget https://packages.microsoft.com/config/debian/10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
elif [[ "$SVER" == "11" ]]; then
wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
fi
echo "Installing dotnet"
echo "Installing dotnet..."
wget https://packages.microsoft.com/config/debian/"$SVER"/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get update; \
sudo apt-get install -y apt-transport-https && \
sudo apt-get update && \
sudo apt-get install -y dotnet-sdk-8.0
echo "Installing Git, Redis and Tmux..."
sudo apt-get install git tmux redis-server -y
echo "Installing Git and Tmux..."
sudo apt-get install git tmux -y
echo "Installing music prerequisites..."
sudo apt-get install libopus0 opus-tools libopus-dev libsodium-dev -y
sudo apt-get install ffmpeg
sudo apt-get install libopus0 libopus-dev libsodium-dev ffmpeg -y
echo ""
sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl
INSTALL_YTDLP
elif [ "$OS" = "Fedora" ]; then
sudo dnf -y install dotnet-sdk-8.0
sudo dnf -y install git
sudo dnf -y install redis
sudo systemctl enable --now redis
sudo dnf -y install git tmux
sudo dnf -y install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
sudo dnf -y install ffmpeg
sudo dnf -y install opus-tools opus libsodium
sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl
INSTALL_YTDLP
elif [ "$OS" = "openSUSE Leap" ] || [ "$OS" = "openSUSE Tumbleweed" ]; then
echo -e "Installing dotnet..."
sudo zypper install -y libicu wget
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
wget https://packages.microsoft.com/config/opensuse/15/prod.repo
sudo mv prod.repo /etc/zypp/repos.d/microsoft-prod.repo
@ -204,77 +100,55 @@ elif [ "$OS" = "openSUSE Leap" ] || [ "$OS" = "openSUSE Tumbleweed" ]; then
echo -e "\nInstalling git, tmux..."
sudo zypper install -y git tmux
echo "Installing redis..."
sudo zypper install -y redis
# Instructions here: https://build.opensuse.org/package/view_file/openSUSE:Factory/redis/README.SUSE?expand=1
sudo cp -a /etc/redis/default.conf.example /etc/redis/ellie.conf
sudo sudo install -d -o redis -g redis -m 0750 /var/lib/redis/ellie/
sudo systemctl start redis@ellie
sudo systemctl enable redis@ellie
echo -e "\nInstalling music prerequisites..."
if [ "$OS" = "openSUSE Leap" ]; then
sudo zypper ar -G -cfp 90 'https://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Leap_$releasever/' packman
else
sudo zypper ar -G -cfp 90 https://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Tumbleweed/ packman
fi
sudo zypper install -y libicu ffmpeg libopus0 libopus-devel opus-tools youtube-dl
sudo zypper install -y ffmpeg libopus0 yt-dlp
elif [ "$OS" = "CentOS" ]; then
if [ "$VER" = "7" ]; then
echo ""
yum -y install sudo
sudo yum -y install libunwind libicu
sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
sudo yum -y install dotnet-sdk-8.0.x86_64
sudo yum -y install http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm epel-release
sudo yum -y install \
https://repo.ius.io/ius-release-el7.rpm \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum -y localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-7.noarch.rpm
sudo yum -y install git222 opus opus-devel ffmpeg ffmpeg-devel tmux yum-utils ca-certificates wget
sudo yum -y install redis
sudo systemctl start redis
sudo systemctl enable redis
sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl
elif [ "$VER" = "8" ]; then
echo -e "*CentOS 8 has reached an End Of Life (EOL) on December 31st, 2021. For more information, see the official CentOS Linux EOL page. Because of this, .NET 6 won't be supported on CentOS Linux 8."
rm e-prereq.sh
exit 1
else
echo -e "Your OS $OS $VER $ARCH probably can run Microsoft .NET Core. \nContact EllieBot's support on Discord with screenshot."
rm e-prereq.sh
exit 1
fi
elif [ "$OS" = "LinuxMint" ]; then
echo "Installing Git, Redis and Tmux..."
sudo apt-get install git tmux redis-server -y
echo "Installing Git and Tmux..."
sudo apt-get update;
sudo apt-get install -y git tmux
echo "Installing dotnet..."
if [ "$SVER" = "19" ]; then
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
elif [ "$SVER" = "20" ]; then
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
elif [ "$SVER" = "21" ]; then
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
fi
echo "Installing dotnet..."
if [ "$SVER" = "19" ] || [ "$SVER" = "20" ]; then
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
elif [ "$SVER" = "21" ]; then
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
fi
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get update;
sudo apt-get install -y apt-transport-https && sudo apt-get update;
sudo apt-get install -y dotnet-sdk-8.0;
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get update && \
sudo apt-get install -y dotnet-sdk-8.0
sudo apt-get install -y apt-transport-https && \
sudo apt-get update;
echo "Installing music prerequisites..."
sudo apt-get install -y libopus0 opus-tools libopus-dev libsodium-dev ffmpeg
INSTALL_YTDLP
elif [ "$OS" = "AlmaLinux" ] || [ "$OS" = "Rocky Linux" ]; then
echo "Installing dotnet..."
sudo dnf install -y dotnet-sdk-8.0
echo "Installing Git and Tmux..."
sudo dnf install -y wget git opus tmux python3.11
echo "Installing music prerequisites..."
if [ "$SVER" = "8" ]; then
sudo dnf -y install https://download.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo yum install yum-utils -y
sudo yum-config-manager --enable powertools
fi
sudo dnf install -y --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-$(rpm -E %rhel).noarch.rpm
sudo dnf install -y ffmpeg
INSTALL_YTDLP
echo "Installing music prerequisites..."
sudo apt-get update
sudo apt-get install libopus0 opus-tools libopus-dev libsodium-dev ffmpeg -y
sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl
elif [ "$OS" = "Darwin" ]; then
brew update
brew install wget git ffmpeg openssl opus opus-tools opusfile libffi libsodium tmux python yt-dlp redis
brew services start redis
brew install wget git ffmpeg openssl opus opus-tools opusfile libffi libsodium tmux python yt-dlp
brew install mono-libgdiplus
fi

View file

@ -7,7 +7,7 @@ rm -rf elliebot_old 1>/dev/null 2>&1
# make a new backup
cp -rT elliebot elliebot_old 1>/dev/null 2>&1
wget -q -N https://toastielab.dev/Emotions-stuff/ellie-bash-installer/raw/branch/v4/rebuild.sh
wget -q -N https://toastielab.dev/Emotions-stuff/ellie-bash-installer/raw/branch/v5/rebuild.sh
bash rebuild.sh
cd "$root"

View file

@ -5,7 +5,7 @@ echo "Downloading the latest installer..."
root=$(pwd)
rm "$root/e-menu.sh" 1>/dev/null 2>&1
wget -N https://toastielab.dev/Emotions-stuff/ellie-bash-installer/raw/branch/v4/e-menu.sh
wget -N https://toastielab.dev/Emotions-stuff/ellie-bash-installer/raw/branch/v5/e-menu.sh
bash e-menu.sh
cd "$root"