Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- apt install dialog -y
- reset
- HEIGHT=15
- WIDTH=40
- CHOICE_HEIGHT=7
- BACKTITLE="UltimateFlarumMaster"
- TITLE="UltimateFlarumMaster by Justman10000 | This is under the GNU General Public License v3.0"
- MENU="What should be done?"
- OPTIONS=(SPU "Systempackages Update"
- PR "Preparation (Must be done first!)"
- V "Check PHP Version"
- 1 "Install"
- 2 "Updating"
- 3 "Uninstall"
- 4 "Exit"
- )
- WhatDo=$(dialog --clear \
- --backtitle "$BACKTITLE" \
- --title "$TITLE" \
- --menu "$MENU" \
- $HEIGHT $WIDTH $CHOICE_HEIGHT \
- "${OPTIONS[@]}" \
- 2>&1 >/dev/tty)
- reset
- case $WhatDo in
- "SPU")
- apt update
- apt upgrade -y
- reset
- bash UltimateFlarummaster.sh
- ;;
- "PR")
- OPTIONS=(1 "Debian"
- 2 "Ubuntu"
- )
- OS=$(dialog --clear \
- --backtitle "$BACKTITLE" \
- --title "$TITLE" \
- --menu "$MENU" \
- $HEIGHT $WIDTH $CHOICE_HEIGHT \
- "${OPTIONS[@]}" \
- 2>&1 >/dev/tty)
- clear
- if ! [ -f /usr/local/bin/composer ]; then
- echo "Installing Composer"
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- php -r "if (hash_file('sha384', 'composer-setup.php') === '906a84df04cea2aa72f40b5f787e49f22d4c2f19492ac310e8cba5b96ac8b64115ac402c8cd292b8a03482574915d1a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
- php composer-setup.php
- php -r "unlink('composer-setup.php');"
- mv composer.phar /usr/local/bin/composer
- clear
- fi
- clear
- echo "Which PHP version should be installed?"
- read PHP
- clear
- apt autoremove -y
- clear
- case $OS in
- "1")
- echo "Scanning"
- sleep 2
- clear
- echo "."
- sleep 1
- clear
- echo ".."
- sleep 1
- clear
- echo "..."
- sleep 2
- clear
- if [ -f /etc/apt/sources.list.d/php.list ]; then
- echo "PHP.list already installed!"
- sleep 2
- echo "Skipping PHP.list installation"
- clear
- fi
- if ! [ -f /etc/apt/sources.list.d/php.list ]; then
- echo "Installing PHP.list"
- wget -q https://packages.sury.org/php/apt.gpg -O- | apt-key add -
- echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php.list
- apt update
- fi
- if ! ( [ "$PHP" == "8.1" ] || [ "$PHP" == "8.2" ]); then
- apt install php$PHP php$PHP-mbstring php$PHP-xml php$PHP-curl php$PHP-gd php$PHP-mysql -y
- fi
- if ( [ "$PHP" == "8.1" ] || [ "$PHP" == "8.2" ]); then
- echo "Anything above PHP 8.0 is not supported by Flarum"
- sleep 2
- fi
- ;;
- "2")
- if ! ( [ "$PHP" == "8.1" ] || [ "$PHP" == "8.2" ]); then
- apt install php$PHP php$PHP-mbstring php$PHP-xml php$PHP-curl php$PHP-gd php$PHP-mysql -y
- fi
- if ( [ "$PHP" == "8.1" ] || [ "$PHP" == "8.2" ]); then
- echo "Anything above PHP 8.0 is not supported by Flarum"
- fi
- echo "Scanning"
- sleep 2
- echo "."
- sleep 2
- clear
- echo ".."
- sleep 2
- clear
- echo "..."
- if [ -f /etc/apt/sources.list.d/php.list ]; then
- echo "PHP.list already installed!"
- sleep 2
- echo "Skipping PHP.list installation"
- fi
- if ! [ -f /etc/apt/sources.list.d/php.list ]; then
- echo "Installing PHP.list"
- apt install software-properties-common -y
- add-apt-repository ppa:ondrej/php
- apt update
- fi
- ;;
- *)
- echo "No OS provided"
- sleep 3
- bash UltimateFlarumMaster.sh
- ;;
- esac
- apt install apache2 -y
- bash UltimateFlarumMaster.sh
- ;;
- "V")
- php -v
- sleep 3
- clear
- bash UltimateFlarumMaster.sh
- ;;
- "1")
- echo "Where should Flarum be installed?"
- read WhereInstall
- clear
- if ! [ WhereInstall ]; then
- echo "This must be stated!"
- sleep 2
- bash UltimateFlarumMaster.sh
- fi
- if ( [ "$WhereInstall" == "." ] && [ -f * ] ); then
- echo "I can't install into the current directory because it's not empty!"
- sleep 2
- bash UltimateFlarumMaster.sh
- fi
- echo "Installing Flarum"
- composer create-project flarum/flarum $WhereInstall
- rm -r $WhereInstall/*.md
- rm -r $WhereInstall/LICENSE
- clear
- echo "Remove .nginx.conf? [Y/N]"
- read NginxConf
- case $NginxConf in
- "Y")
- rm -r $WhereInstall/.nginx.conf
- ;;
- "N")
- ;;
- *)
- echo "This must be stated!"
- sleep 2
- bash UltimateFlarumMaster.sh
- ;;
- esac
- clear
- echo "Remove web.config? [Y/N]"
- read WebConf
- case $WebConf in
- "Y")
- rm -r $WhereInstall/web.config
- rm -r $WhereInstall/public/web.config
- ;;
- "N")
- ;;
- *)
- echo "This must be stated!"
- sleep 2
- bash UltimateFlarumMaster.sh
- ;;
- esac
- echo "Remove .editorconfig? [Y/N]"
- read EditorConf
- case $EditorConf in
- "Y")
- rm -r $WhereInstall/.editorconfig
- ;;
- "N")
- ;;
- *)
- echo "This must be stated!"
- sleep 2
- bash UltimateFlarumMaster.sh
- ;;
- esac
- clear
- HEIGHT=15
- WIDTH=40
- CHOICE_HEIGHT=2
- BACKTITLE="UltimateFlarumMaster"
- TITLE="UltimateFlarumMaster by Justman10000 | This is under the GNU General Public License v3.0"
- MENU="How should Flarum be confgure? That it on..."
- OPTIONS=(1 "a domain or subdomain is running (mydomain.tld or flarum.mydomain.tld)"
- 2 "a underfolder is running (mydomain.tld/flarum)"
- )
- HowConfigure=$(dialog --clear \
- --backtitle "$BACKTITLE" \
- --title "$TITLE" \
- --menu "$MENU" \
- $HEIGHT $WIDTH $CHOICE_HEIGHT \
- "${OPTIONS[@]}" \
- 2>&1 >/dev/tty)
- clear
- case $HowConfigure in
- "1")
- mv $WhereInstall/public/* $WhereInstall/.
- rm -r $WhereInstall/public
- wget https://pastebin.com/raw/xiLiHdQa
- mv xiLiHdQa $WhereInstall/.htaccess
- rm -r $WhereInstall/index.php
- wget https://pastebin.com/raw/jE3R2saj
- mv jE3R2saj $WhereInstall/index.php
- rm -r $WhereInstall/site.php
- wget https://pastebin.com/raw/VrsJfRRz
- mv VrsJfRRz $WhereInstall/site.php
- ;;
- "2")
- ;;
- esac
- chmod -R 777 $WhereInstall
- bash UltimateFlarumMaster.sh
- ;;
- "2")
- composer update
- reset
- bash UltimateFlarumMaster.sh
- ;;
- "3")
- echo "Where is Flarum be installed?"
- read WhereInstall
- if [ "$WhereInstall" ]; then
- rm -r $WhereInstall/*
- rm -r $WhereInstall/.*
- clear
- echo "Remove directory? [Y/N]"
- read RemoveDiretory
- case $RemoveDiretory in
- "Y")
- rm -r $WhereInstall
- ;;
- "N")
- ;;
- *)
- echo "This must be stated!"
- sleep 2
- bash UltimateFlarumMaster.sh
- ;;
- esac
- fi
- if ! [ "$WhereInstall" ]; then
- echo "This must be stated"
- sleep 2
- bash UltimateFlarumMaster.sh
- fi
- clear
- bash UltimateFlarumMaster.sh
- ;;
- "4")
- echo "Exit"
- sleep 2
- clear
- bash UltimateFlarumMaster.sh
- ;;
- esac
Advertisement
RAW Paste Data
Copied
Advertisement