Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- function Cancel() {
- if [ "$Quit" -eq "1" ]; then
- exit 1
- fi
- }
- function InstallWhat() {
- if [[ $Options == *"Apache"* ]]; then
- InstallApache=1
- echo "Install Apache"
- let "TotalInstall=TotalInstall+1"
- fi
- if [[ $Options == *"Jacket"* ]]; then
- InstallJacket=1
- echo "Install Jacket"
- let "TotalInstall=TotalInstall+1"
- fi
- if [[ $Options == *"NextCloud (Requires apache)"* ]]; then
- InstallNextCloud=1
- echo "Install NextCloud"
- let "TotalInstall=TotalInstall+1"
- fi
- if [[ $Options == *"Plex"* ]]; then
- InstallPlex=1
- echo "Install Plex"
- let "TotalInstall=TotalInstall+1"
- fi
- if [[ $Options == *"Raid Card (rr278x)"* ]]; then
- InstallRaidCard=1
- echo "Install Raid Card"
- let "TotalInstall=TotalInstall+1"
- fi
- if [[ $Options == *"Sonarr"* ]]; then
- InstallSonarr=1
- echo "Install Sonarr"
- let "TotalInstall=TotalInstall+1"
- fi
- if [[ $Options == *"Samba"* ]]; then
- InstallSamba=1
- echo "Install Samba"
- let "TotalInstall=TotalInstall+1"
- fi
- if [[ $Options == *"Transmission"* ]]; then
- InstallTransmission=1
- echo "Install Transmission"
- let "TotalInstall=TotalInstall+1"
- fi
- if [[ $Options == *"VNC"* ]]; then
- InstallVNC=1
- echo "Install VNC"
- let "TotalInstall=TotalInstall+1"
- fi
- }
- function UserExist() {
- awk -F":" '{ print $1 }' /etc/passwd | grep -x $1 > /dev/null
- if [ "$?" -eq "0" ]; then
- zenity --error --timeout 3 --text="$1 user is already used, please choose another username\!"
- Valid=0
- else
- zenity --info --timeout 2 --text="$1 user will be create"
- Valid=1
- fi
- }
- function TestValidUsername() {
- isValidUsername() {
- local re='^[[:lower:]_][[:lower:][:digit:]_-]{2,15}$'
- (( ${#1} > 16 )) && return 1
- [[ $1 =~ $re ]] # return value of this comparison is used for the function
- }
- if isValidUsername "$1"; then
- zenity --info --timeout 2 --text="$1 is a valid username"
- else
- zenity --error --timeout 3 --text="$1 is not a valid username\!"
- NotValidUser=1
- fi
- }
- function ApacheInstall() {
- sudo apt install -y apache2
- Domain=$(zenity --text "Please enter you domain name (example.com)" --entry)
- # Disable directory listing #
- sudo sed -i "s/Options Indexes FollowSymLinks/Options FollowSymLinks/" /etc/apache2/apache2.conf
- sudo systemctl stop apache2.service
- sudo a2enmod rewrite
- sudo a2enmod headers
- sudo a2enmod env
- sudo a2enmod dir
- sudo a2enmod mime
- sudo systemctl start apache2.service
- sudo systemctl enable apache2.service
- }
- function Jackett-Install() {
- mkdir -p /opt/jackett
- sudo apt-get update -y
- sudo apt-get install -y libcurl4-openssl-dev bzip2 mono-devel -y
- cd /tmp
- wget https://github.com/Jackett/Jackett/releases/download/v0.8.832/Jackett.Binaries.Mono.tar.gz
- sudo tar -xvf Jackett*
- sudo mv Jackett/* /opt/jackett
- sudo chown -R $Admin:$Admin /opt/jackett
- cat <<-EOF > /etc/systemd/system/jackett.service
- [Unit]
- Description=Jackett Daemon
- After=network.target
- [Service]
- User=root
- Restart=always
- RestartSec=5
- Type=simple
- ExecStart=/usr/bin/mono --debug /opt/jackett/JackettConsole.exe --NoRestart
- TimeoutStopSec=20
- [Install]
- WantedBy=multi-user.target
- EOF
- sudo systemctl enable jackett
- sudo service jackett start
- }
- function CreateDB-bash() {
- cat <<-EOF > /usr/bin/createdb
- #!/bin/bash
- EXPECTED_ARGS=3
- E_BADARGS=65
- MYSQL=`which mysql`
- Q1="CREATE DATABASE $1;"
- Q2="GRANT USAGE ON *.* TO $2@localhost IDENTIFIED BY '$3';"
- Q3="GRANT ALL PRIVILEGES ON $1.* TO $2@localhost;"
- Q4="FLUSH PRIVILEGES;"
- SQL="${Q1}${Q2}${Q3}${Q4}"
- if [ $# -ne $EXPECTED_ARGS ]
- then
- echo "Usage: $0 dbname dbuser dbpass"
- exit $E_BADARGS
- fi
- $MYSQL -uroot -p -e "$SQL"
- EOF
- sudo chmod 755 /usr/bin/createdb
- }
- function Dwnld-Ombi() {
- mkdir -p /opt/Ombi
- cd /opt/Ombi
- wget https://github.com/tidusjar/Ombi/releases/download/v3.0.3111/linux.tar.gz
- sudo tar xzf linux.tar.gz
- sudo chmod +x Ombi
- sudo apt-get install libicu-dev
- sudo apt-get install libunwind8
- sudo apt-get install libcurl4-openssl-dev
- cat <<-EOF > /etc/systemd/system/ombi.service
- [Unit]
- Description=Ombi - PMS Requests System
- After=network-online.target
- [Service]
- User=root
- Group=root
- WorkingDirectory=/opt/Ombi/
- ExecStart=/opt/Ombi/Ombi
- Type=simple
- TimeoutStopSec=30
- Restart=on-failure
- RestartSec=5
- [Install]
- WantedBy=multi-user.target
- EOF
- sudo systemctl daemon-reload
- sudo systemctl start ombi
- sudo systemctl enable ombi.service
- if [ "$ApacheInstall" -eq "1" ]; then
- cat <<-EOF > /etc/apache2/sites-available/request.conf
- <VirtualHost *:80>
- ServerName request.$Domain
- ProxyRequests off
- ProxyPreserveHost on
- ProxyPass / http://localhost:5000/
- ProxyPassReverse / http://localhost:5000/
- </VirtualHost>
- EOF
- sudo a2ensite request.conf
- fi
- }
- function Dwnld-NextCloud() {
- temp=$(zenity --text "Enter the NextCloud base directory (I'll create it in need be)" --entry)
- if [ -d "$temp" ]; then
- echo "Path exists"
- else
- echo "Path doesn't exist, i'll create it!"
- sudo mkdir -p "$temp"
- fi
- cd /tmp && wget https://download.nextcloud.com/server/releases/nextcloud-11.0.1.zip
- sudo unzip nextcloud-11.0.1.zip
- sudo mv nextcloud /var/www/html/nextcloud/
- cat <<-EOF > /etc/apache2/sites-available/nextcloud.conf
- <VirtualHost *:80>
- DocumentRoot /var/www/html/nextcloud/
- ServerName cloud.$Domain
- Alias /nextcloud "/var/www/html/nextcloud/"
- <Directory /var/www/html/nextcloud/>
- Options +FollowSymlinks
- AllowOverride All
- Require all granted
- <IfModule mod_dav.c>
- Dav off
- </IfModule>
- SetEnv HOME /var/www/html/nextcloud
- SetEnv HTTP_HOME /var/www/html/nextcloud
- </Directory>
- ErrorLog ${APACHE_LOG_DIR}/error.log
- CustomLog ${APACHE_LOG_DIR}/access.log combined
- </VirtualHost>
- EOF
- sudo a2ensite nextcloud.conf
- sudo chown -R www-data:www-data /var/www/html/nextcloud/
- sudo chmod -R 755 /var/www/html/nextcloud/
- }
- function Plex-Install() {
- sudo mkdir -p /Plex/1.0-2.0
- echo deb https://downloads.plex.tv/repo/deb ./public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
- sudo apt-get update -y
- curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add -
- sudo apt-get update -y
- Sudo apt-get install -y plexmediaserver
- echo "[Plex Plug-ins]
- path = /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins
- valid users = @smbgrp
- guest ok = no
- writable = yes
- browsable = yes
- [Plex 1.0-2.0]
- path = /Plex/1.0-2.0
- valid users = @smbgrp
- guest ok = no
- writable = yes
- browsable = yes" >> /etc/samba/smb.conf
- }
- function Raid-Card-Install() {
- sudo apt-get install -y alien
- #### Make instal and start Drivers ####
- cd /tmp
- sudo wget 'https://www.dropbox.com/s/fkgeez3w9uat9jd/rr278x-linux-src-v1.1.16.zip?dl=1' -O 'rr278x-linux-src-v1.1.16.zip' -c
- sudo unzip rr278x-linux-src-v1.1.16.zip
- cd /tmp/rr278x-linux-src-v1.1.16/product/rr278x/linux
- make install
- modprobe rr278x
- #### Install web managment app ####
- cd /tmp
- arch=$(uname -m)
- if [ "$arch" -eq "x86_64" ]; then
- sudo wget 'https://www.dropbox.com/s/4819uxc6lxzyq6x/hptsvr-https-2.1.5-13.0409.x86_64.rpm?dl=1' -O 'hptsvr-https-2.1.5-13.0409.x86_64.rpm' -c
- sudo alien --scripts --install /tmp/hptsvr-https-2.1.5-13.0409.x86_64.rpm
- else
- sudo wget 'https://www.dropbox.com/s/c7rko8j4xnxsucq/hptsvr-https-2.1.5-13.0409.i386.rpm?dl=1' -O 'hptsvr-https-2.1.5-13.0409.i386.rpm' -c
- sudo alien --scripts --install /tmp/hptsvr-https-2.1.5-13.0409.i386.rpm
- }
- function Sonarr-Install() {
- sudo mkdir -p /opt/NzbDrone
- sudo apt-get install -y libmono-cil-dev
- sudo apt-get install apt-transport-https -y
- sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FDA5DFFC
- sudo apt-get update -yes
- sudo apt-get install -y nzbdrone
- sudo rm /etc/apt/sources.list.d/sonarr.list
- sudo chown -R "$Admin":"$Admin" /opt/NzbDrone
- cd /etc/systemd/system/
- cat <<-EOF > sonarr.service
- [Unit]
- Description=Sonarr Daemon
- After=network.target
- [Service]
- User=plex-admin
- Group=plex-admin
- Type=simple
- ExecStart=/usr/bin/mono /opt/NzbDrone/NzbDrone.exe -nobrowser
- TimeoutStopSec=20
- KillMode=process
- Restart=on-failure
- [Install]
- WantedBy=multi-user.target
- EOF
- sudo systemctl enable sonarr.service
- sudo systemctl start sonarr.service
- if [ "$ApacheInstall" -eq "1" ]; then
- cat <<-EOF > /etc/apache2/sites-available/sonarr.conf
- <VirtualHost *:80>
- ServerName sonarr.$Domain
- ProxyRequests off
- ProxyPreserveHost on
- ProxyPass / http://localhost:8989/
- ProxyPassReverse / http://localhost:8989/
- </VirtualHost>
- EOF
- sudo a2ensite sonarr.conf
- fi
- }
- function Transmission-Install() {
- function replace-password() {
- local file="settings.json"
- local line_num="51"
- local replacement=' "rpc-password": '"$AdminPass"','
- # Escape backslash, forward slash and ampersand for use as a sed replacement.
- replacement_escaped=$( echo "$replacement" | sed -e 's/[\/&]/\\&/g' )
- sed -i "${line_num}s/.*/$replacement_escaped/" "$file"
- }
- function replace-username() {
- local file="settings.json"
- local line_num="54"
- local replacement=' "rpc-username": '"$Admin"','
- # Escape backslash, forward slash and ampersand for use as a sed replacement.
- replacement_escaped=$( echo "$replacement" | sed -e 's/[\/&]/\\&/g' )
- sed -i "${line_num}s/.*/$replacement_escaped/" "$file"
- }
- function replace-whitelist-enabled() {
- local file="settings.json"
- local line_num="56"
- local replacement=' "rpc-whitelist-enabled": "false",'
- # Escape backslash, forward slash and ampersand for use as a sed replacement.
- replacement_escaped=$( echo "$replacement" | sed -e 's/[\/&]/\\&/g' )
- sed -i "${line_num}s/.*/$replacement_escaped/" "$file"
- }
- function replace-download-dir() {
- local file="settings.json"
- local line_num="15"
- local replacement=' "download-dir": '"$DwlDir"','
- # Escape backslash, forward slash and ampersand for use as a sed replacement.
- replacement_escaped=$( echo "$replacement" | sed -e 's/[\/&]/\\&/g' )
- sed -i "${line_num}s/.*/$replacement_escaped/" "$file"
- }
- function replace-incomplete-download-dir() {
- local file="settings.json"
- local line_num="73"
- local replacement=' "download-dir": '"$IncDwlDir"','
- # Escape backslash, forward slash and ampersand for use as a sed replacement.
- replacement_escaped=$( echo "$replacement" | sed -e 's/[\/&]/\\&/g' )
- sed -i "${line_num}s/.*/$replacement_escaped/" "$file"
- }
- sudo add-apt-repository ppa:transmissionbt/ppa -y
- sudo apt update -y
- sudo apt install -y transmission-cli transmission-common transmission-daemon
- sudo service transmission-daemon stop
- cd /var/lib/transmission-daemon/info
- replace-password
- replace-username
- replace-whitelist-enabled
- DwlDir=$(zenity --text "Enter the download dirrectory for transmission (I'll create it in need be)" --entry)
- IncDwlDir=$(zenity --text "Enter the incomplete download dirrectory for transmission (I'll create it in need be)" --entry)
- if [ -d "$DwlDir" ]; then
- echo "Path exists"
- replace-download-dir
- else
- echo "Path doesn't exist, i'll create it!"
- sudo mkdir -p "$DwlDir"
- fi
- if [ -d "$IncDwlDir" ]; then
- echo "Path exists"
- replace-incomplete-download-dir
- else
- echo "Path doesn't exist, i'll create it!"
- sudo mkdir -p "$IncDwlDir"
- fi
- sudo service transmission-daemon start
- if [ "$ApacheInstall" -eq "1" ]; then
- cat <<-EOF > /etc/apache2/sites-available/torrent.conf
- <VirtualHost *:80>
- ServerName torrent.$Domain
- ProxyRequests off
- ProxyPreserveHost on
- ProxyPass / http://localhost:9091/
- ProxyPassReverse / http://localhost:9091/
- </VirtualHost>
- EOF
- sudo a2ensite torrent.conf
- fi
- }
- function NextCloud-Pre() {
- function File-Uploads() {
- local file="php.ini"
- local line_num="815"
- local replacement='file_uploads = On'
- # Escape backslash, forward slash and ampersand for use as a sed replacement.
- replacement_escaped=$( echo "$replacement" | sed -e 's/[\/&]/\\&/g' )
- sed -i "${line_num}s/.*/$replacement_escaped/" "$file"
- }
- function Allow-Url-Fopen() {
- local file="php.ini"
- local line_num="835"
- local replacement='allow_url_fopen = On'
- # Escape backslash, forward slash and ampersand for use as a sed replacement.
- replacement_escaped=$( echo "$replacement" | sed -e 's/[\/&]/\\&/g' )
- sed -i "${line_num}s/.*/$replacement_escaped/" "$file"
- }
- function Memory-Limit() {
- local file="php.ini"
- local line_num="404"
- local replacement='memory_limit = 256M'
- # Escape backslash, forward slash and ampersand for use as a sed replacement.
- replacement_escaped=$( echo "$replacement" | sed -e 's/[\/&]/\\&/g' )
- sed -i "${line_num}s/.*/$replacement_escaped/" "$file"
- }
- function Upload-Max() {
- local file="php.ini"
- local line_num="824"
- local replacement='upload_max_filesize = 1G'
- # Escape backslash, forward slash and ampersand for use as a sed replacement.
- replacement_escaped=$( echo "$replacement" | sed -e 's/[\/&]/\\&/g' )
- sed -i "${line_num}s/.*/$replacement_escaped/" "$file"
- }
- function Max-File-Upload() {
- local file="php.ini"
- local line_num="827"
- local replacement='max_file_uploads = 40'
- # Escape backslash, forward slash and ampersand for use as a sed replacement.
- replacement_escaped=$( echo "$replacement" | sed -e 's/[\/&]/\\&/g' )
- sed -i "${line_num}s/.*/$replacement_escaped/" "$file"
- }
- function Max-Exec-Time() {
- local file="php.ini"
- local line_num="383"
- local replacement='max_execution_time = 360'
- # Escape backslash, forward slash and ampersand for use as a sed replacement.
- replacement_escaped=$( echo "$replacement" | sed -e 's/[\/&]/\\&/g' )
- sed -i "${line_num}s/.*/$replacement_escaped/" "$file"
- }
- function Date-Timezone() {
- local file="php.ini"
- local line_num="939"
- local replacement="date.timezone = $Area"
- # Escape backslash, forward slash and ampersand for use as a sed replacement.
- replacement_escaped=$( echo "$replacement" | sed -e 's/[\/&]/\\&/g' )
- sed -i "${line_num}s/.*/$replacement_escaped/" "$file"
- }
- function AreaSet(){
- Area=$(zenity --entry --title "Land Mass" --text "${Area[@]}" --text "Please choose the appropriat one for your country.")
- retval=$?
- case $retval in
- 0)
- if [ "$Area" == "Africa" ]; then
- AreaTemp=$(zenity --entry --title "Land Mass" --text "${Africa[@]}" --text "Please choose the appropriat one for your country.")
- retval=$?
- case $retval in
- 0)
- Area="$AreaTemp"
- ;;
- 1)
- AreaSet
- ;;
- esac
- elif [ "$Area" == "America" ]; then
- AreaTemp=$(zenity --entry --title "Land Mass" --text "${America[@]}" --text "Please choose the appropriat one for your country.")
- retval=$?
- case $retval in
- 0)
- Area="$AreaTemp"
- ;;
- 1)
- AreaSet
- ;;
- esac
- elif [ "$Area" == "Antarctica" ]; then
- AreaTemp=$(zenity --entry --title "Land Mass" --text "${Antarctica[@]}" --text "Please choose the appropriat one for your country.")
- retval=$?
- case $retval in
- 0)
- Area="$AreaTemp"
- ;;
- 1)
- AreaSet
- ;;
- esac
- elif [ "$Area" == "Arctic" ]; then
- AreaTemp=$(zenity --entry --title "Land Mass" --text "${Arctic[@]}" --text "Please choose the appropriat one for your country.")
- retval=$?
- case $retval in
- 0)
- Area="$AreaTemp"
- ;;
- 1)
- AreaSet
- ;;
- esac
- elif [ "$Area" == "Asia" ]; then
- AreaTemp=$(zenity --entry --title "Land Mass" --text "${Asia[@]}" --text "Please choose the appropriat one for your country.")
- retval=$?
- case $retval in
- 0)
- Area="$AreaTemp"
- ;;
- 1)
- AreaSet
- ;;
- esac
- elif [ "$Area" == "Atlantic" ]; then
- AreaTemp=$(zenity --entry --title "Land Mass" --text "${Atlantic[@]}" --text "Please choose the appropriat one for your country.")
- retval=$?
- case $retval in
- 0)
- Area="$AreaTemp"
- ;;
- 1)
- AreaSet
- ;;
- esac
- elif [ "$Area" == "Australia" ]; then
- AreaTemp=$(zenity --entry --title "Land Mass" --text "${Australia[@]}" --text "Please choose the appropriat one for your country.")
- retval=$?
- case $retval in
- 0)
- Area="$AreaTemp"
- ;;
- 1)
- AreaSet
- ;;
- esac
- elif [ "$Area" == "Europe" ]; then
- AreaTemp=$(zenity --entry --title "Land Mass" --text "${Europe[@]}" --text "Please choose the appropriat one for your country.")
- retval=$?
- case $retval in
- 0)
- Area="$AreaTemp"
- ;;
- 1)
- AreaSet
- ;;
- esac
- elif [ "$Area" == "Indian" ]; then
- AreaTemp=$(zenity --entry --title "Land Mass" --text "${Indian[@]}" --text "Please choose the appropriat one for your country.")
- retval=$?
- case $retval in
- 0)
- Area="$AreaTemp"
- ;;
- 1)
- AreaSet
- ;;
- esac
- elif [ "$Area" == "Pacific" ]; then
- AreaTemp=$(zenity --entry --title "Land Mass" --text "${Pacific[@]}" --text "Please choose the appropriat one for your country.")
- retval=$?
- case $retval in
- 0)
- Area="$AreaTemp"
- ;;
- 1)
- AreaSet
- ;;
- esac
- fi;;
- 1)
- echo "Will Default to Europe/London"
- ;;
- esac
- }
- sudo apt-get install -y mariadb-server mariadb-client
- sudo systemctl stop mysql.service
- sudo systemctl start mysql.service
- sudo systemctl enable mysql.service
- echo -e '\ny\n$MySQLPass\n$MySQLPass\ny\ny\ny\ny\n' | sudo mysql_secure_installation
- sudo systemctl restart mysql.service
- sudo apt-get install -y software-properties-common
- sudo add-apt-repository -y ppa:ondrej/php
- sudo apt update -y
- sudo apt install -y php7.1 libapache2-mod-php7.1 php7.1-common libapache2-mod-php7.1 php7.1-mbstring php7.1-xmlrpc php7.1-soap php7.1-apcu php7.1-smbclient php7.1-ldap php7.1-redis php7.1-gd php7.1-xml php7.1-intl php7.1-json php7.1-imagick php7.1-mysql php7.1-cli php7.1-mcrypt php7.1-ldap php7.1-zip php7.1-curl
- cd /etc/php/7.1/apache2/
- File-Uploads
- Allow-Url-Fopen
- Memory-Limit
- Upload-Max
- Max-File-Upload
- Max-Exec-Time
- AreaSet
- Date-Timezone
- }
- function VNC-Install() {
- apt install xfce4 xfce4-goodies tightvncserver
- vncserver
- vncserver -kill :1
- mv ~/.vnc/xstartup ~/.vnc/xstartup.bak
- echo "#!/bin/bash
- xrdb $HOME/.Xresources
- startxfce4 &" > ~/.vnc/xstartup
- chmod +x ~/.vnc/xstartup
- sudo vncserver :1
- cd /
- echo "@reboot /usr/bin/vncserver :1" >> Newcron
- crontab Newcron
- }
- function Samba-Install() {
- sudo apt install -y samba samba-common python-glade2 system-config-samba
- sudo mkdir -p /samba/anonymous
- sudo mkdir -p /samba/secured
- echo "
- [Anonymous]
- path = /samba/anonymous
- browsable =yes
- writable = yes
- guest ok = yes
- read only = no
- force user = nobody
- [Secured]
- path = /samba/secured
- valid users = @smbgrp
- guest ok = no
- writable = yes
- browsable = yes
- [Temp]
- path = /tmp
- valid users = @smbgrp
- guest ok = no
- writable = yes
- browsable = yes" >> /etc/samba/smb.conf
- sudo addgroup smbgrp
- echo -e "Admin user "$Admin" added to samba group"
- sudo usermod -a -G smbgrp "$Admin"
- sudo smbpasswd -a "$Admin"
- for i in "${Users[@]}"; do
- echo -e "User $i added to samba group"
- sudo usermod -a -G smbgrp "$i"
- sudo smbpasswd -a "$i"
- done
- sudo chmod -R 0775 /samba/anonymous
- sudo chmod -R 0770 /samba/secured
- sudo chown -R nobody:nogroup /samba/anonymous
- sudo chown root:smbgrp /samba/secured
- sudo service smbd restart
- }
- function SSL() {
- sudo add-apt-repository ppa:certbot/certbot
- sudo apt-get -y update
- sudo apt-get install -y python-certbot-apache
- sudo certbot --apache
- }
- ########################
- # Start of Program #
- ########################
- #### Global Variables ####
- Arrays
- Area=(0 Africa America Antarctica Arctic Asia Atlantic Australia Europe Indian Pacific)
- Africa=(0 Africa/Abidjan Africa/Accra Africa/Addis_Ababa Africa/Algiers
- Africa/Asmara Africa/Bamako Africa/Bangui Africa/Banjul
- Africa/Bissau Africa/Blantyre Africa/Brazzaville Africa/Bujumbura
- Africa/Cairo Africa/Casablanca Africa/Ceuta Africa/Conakry
- Africa/Dakar Africa/Dar_es_Salaam Africa/Djibouti Africa/Douala
- Africa/El_Aaiun Africa/Freetown Africa/Gaborone Africa/Harare
- Africa/Johannesburg Africa/Juba Africa/Kampala Africa/Khartoum
- Africa/Kigali Africa/Kinshasa Africa/Lagos Africa/Libreville
- Africa/Lome Africa/Luanda Africa/Lubumbashi Africa/Lusaka
- Africa/Malabo Africa/Maputo Africa/Maseru Africa/Mbabane
- Africa/Mogadishu Africa/Monrovia Africa/Nairobi Africa/Ndjamena
- Africa/Niamey Africa/Nouakchott Africa/Ouagadougou Africa/Porto-Novo
- Africa/Sao_Tome Africa/Tripoli Africa/Tunis Africa/Windhoek)
- America=(0 America/Adak America/Anchorage America/Anguilla America/Antigua
- America/Araguaina America/Argentina/Buenos_Aires America/Argentina/Catamarca America/Argentina/Cordoba
- America/Argentina/Jujuy America/Argentina/La_Rioja America/Argentina/Mendoza America/Argentina/Rio_Gallegos
- America/Argentina/Salta America/Argentina/San_Juan America/Argentina/San_Luis America/Argentina/Tucuman
- America/Argentina/Ushuaia America/Aruba America/Asuncion America/Atikokan
- America/Bahia America/Bahia_Banderas America/Barbados America/Belem
- America/Belize America/Blanc-Sablon America/Boa_Vista America/Bogota
- America/Boise America/Cambridge_Bay America/Campo_Grande America/Cancun
- America/Caracas America/Cayenne America/Cayman America/Chicago
- America/Chihuahua America/Costa_Rica America/Creston America/Cuiaba
- America/Curacao America/Danmarkshavn America/Dawson America/Dawson_Creek
- America/Denver America/Detroit America/Dominica America/Edmonton
- America/Eirunepe America/El_Salvador America/Fort_Nelson America/Fortaleza
- America/Glace_Bay America/Godthab America/Goose_Bay America/Grand_Turk
- America/Grenada America/Guadeloupe America/Guatemala America/Guayaquil
- America/Guyana America/Halifax America/Havana America/Hermosillo
- America/Indiana/Indianapolis America/Indiana/Knox America/Indiana/Marengo America/Indiana/Petersburg
- America/Indiana/Tell_City America/Indiana/Vevay America/Indiana/Vincennes America/Indiana/Winamac
- America/Inuvik America/Iqaluit America/Jamaica America/Juneau
- America/Kentucky/Louisville America/Kentucky/Monticello America/Kralendijk America/La_Paz
- America/Lima America/Los_Angeles America/Lower_Princes America/Maceio
- America/Managua America/Manaus America/Marigot America/Martinique
- America/Matamoros America/Mazatlan America/Menominee America/Merida
- America/Metlakatla America/Mexico_City America/Miquelon America/Moncton
- America/Monterrey America/Montevideo America/Montserrat America/Nassau
- America/New_York America/Nipigon America/Nome America/Noronha
- America/North_Dakota/Beulah America/North_Dakota/Center America/North_Dakota/New_Salem America/Ojinaga
- America/Panama America/Pangnirtung America/Paramaribo America/Phoenix
- America/Port-au-Prince America/Port_of_Spain America/Porto_Velho America/Puerto_Rico
- America/Punta_Arenas America/Rainy_River America/Rankin_Inlet America/Recife
- America/Regina America/Resolute America/Rio_Branco America/Santarem
- America/Santiago America/Santo_Domingo America/Sao_Paulo America/Scoresbysund
- America/Sitka America/St_Barthelemy America/St_Johns America/St_Kitts
- America/St_Lucia America/St_Thomas America/St_Vincent America/Swift_Current
- America/Tegucigalpa America/Thule America/Thunder_Bay America/Tijuana
- America/Toronto America/Tortola America/Vancouver America/Whitehorse
- America/Winnipeg America/Yakutat America/Yellowknife)
- Antarctica=(0 Antarctica/Casey Antarctica/Davis Antarctica/DumontDUrville Antarctica/Macquarie
- Antarctica/Mawson Antarctica/McMurdo Antarctica/Palmer Antarctica/Rothera
- Antarctica/Syowa Antarctica/Troll Antarctica/Vostok)
- Artic=(0 Arctic/Longyearbyen)
- Asia=(0 Asia/Aden Asia/Almaty Asia/Amman Asia/Anadyr
- Asia/Aqtau Asia/Aqtobe Asia/Ashgabat Asia/Atyrau
- Asia/Baghdad Asia/Bahrain Asia/Baku Asia/Bangkok
- Asia/Barnaul Asia/Beirut Asia/Bishkek Asia/Brunei
- Asia/Chita Asia/Choibalsan Asia/Colombo Asia/Damascus
- Asia/Dhaka Asia/Dili Asia/Dubai Asia/Dushanbe
- Asia/Famagusta Asia/Gaza Asia/Hebron Asia/Ho_Chi_Minh
- Asia/Hong_Kong Asia/Hovd Asia/Irkutsk Asia/Jakarta
- Asia/Jayapura Asia/Jerusalem Asia/Kabul Asia/Kamchatka
- Asia/Karachi Asia/Kathmandu Asia/Khandyga Asia/Kolkata
- Asia/Krasnoyarsk Asia/Kuala_Lumpur Asia/Kuching Asia/Kuwait
- Asia/Macau Asia/Magadan Asia/Makassar Asia/Manila
- Asia/Muscat Asia/Nicosia Asia/Novokuznetsk Asia/Novosibirsk
- Asia/Omsk Asia/Oral Asia/Phnom_Penh Asia/Pontianak
- Asia/Pyongyang Asia/Qatar Asia/Qyzylorda Asia/Riyadh
- Asia/Sakhalin Asia/Samarkand Asia/Seoul Asia/Shanghai
- Asia/Singapore Asia/Srednekolymsk Asia/Taipei Asia/Tashkent
- Asia/Tbilisi Asia/Tehran Asia/Thimphu Asia/Tokyo
- Asia/Tomsk Asia/Ulaanbaatar Asia/Urumqi Asia/Ust-Nera
- Asia/Vientiane Asia/Vladivostok Asia/Yakutsk Asia/Yangon
- Asia/Yekaterinburg Asia/Yerevan)
- Atlantic=(0 Atlantic/Azores Atlantic/Bermuda Atlantic/Canary Atlantic/Cape_Verde
- Atlantic/Faroe Atlantic/Madeira Atlantic/Reykjavik Atlantic/South_Georgia
- Atlantic/St_Helena Atlantic/Stanley)
- Australia=(0 Australia/Adelaide Australia/Brisbane Australia/Broken_Hill Australia/Currie
- Australia/Darwin Australia/Eucla Australia/Hobart Australia/Lindeman
- Australia/Lord_Howe Australia/Melbourne Australia/Perth Australia/Sydney)
- Europe=(0 Europe/Amsterdam Europe/Andorra Europe/Astrakhan Europe/Athens
- Europe/Belgrade Europe/Berlin Europe/Bratislava Europe/Brussels
- Europe/Bucharest Europe/Budapest Europe/Busingen Europe/Chisinau
- Europe/Copenhagen Europe/Dublin Europe/Gibraltar Europe/Guernsey
- Europe/Helsinki Europe/Isle_of_Man Europe/Istanbul Europe/Jersey
- Europe/Kaliningrad Europe/Kiev Europe/Kirov Europe/Lisbon
- Europe/Ljubljana Europe/London Europe/Luxembourg Europe/Madrid
- Europe/Malta Europe/Mariehamn Europe/Minsk Europe/Monaco
- Europe/Moscow Europe/Oslo Europe/Paris Europe/Podgorica
- Europe/Prague Europe/Riga Europe/Rome Europe/Samara
- Europe/San_Marino Europe/Sarajevo Europe/Saratov Europe/Simferopol
- Europe/Skopje Europe/Sofia Europe/Stockholm Europe/Tallinn
- Europe/Tirane Europe/Ulyanovsk Europe/Uzhgorod Europe/Vaduz
- Europe/Vatican Europe/Vienna Europe/Vilnius Europe/Volgograd
- Europe/Warsaw Europe/Zagreb Europe/Zaporozhye Europe/Zurich)
- Indian=(0 Indian/Antananarivo Indian/Chagos Indian/Christmas Indian/Cocos
- Indian/Comoro Indian/Kerguelen Indian/Mahe Indian/Maldives
- Indian/Mauritius Indian/Mayotte Indian/Reunion)
- Pacific=(0 Pacific/Apia Pacific/Auckland Pacific/Bougainville Pacific/Chatham
- Pacific/Chuuk Pacific/Easter Pacific/Efate Pacific/Enderbury
- Pacific/Fakaofo Pacific/Fiji Pacific/Funafuti Pacific/Galapagos
- Pacific/Gambier Pacific/Guadalcanal Pacific/Guam Pacific/Honolulu
- Pacific/Kiritimati Pacific/Kosrae Pacific/Kwajalein Pacific/Majuro
- Pacific/Marquesas Pacific/Midway Pacific/Nauru Pacific/Niue
- Pacific/Norfolk Pacific/Noumea Pacific/Pago_Pago Pacific/Palau
- Pacific/Pitcairn Pacific/Pohnpei Pacific/Port_Moresby Pacific/Rarotonga
- Pacific/Saipan Pacific/Tahiti Pacific/Tarawa Pacific/Tongatapu
- Pacific/Wake Pacific/Wallis)
- AdditionalUsers=1
- AdminSet=0
- AdminPassSet=0
- InstallApache=0
- InstallJacket=0
- InstallNextCloud=0
- InstallPlex=0
- InstallRaidCard=0
- InstallSonarr=0
- InstallSamba=0
- InstallTransmission=0
- InstallVNC=0
- NotValidUser=0
- Quit=0
- TotalInstall=0
- Valid=0
- Admin=""
- AdminPass=""
- Area=""
- DwlDir=""
- Domain=""
- IncDwlDir=""
- MySQLPass=""
- Options=""
- User=""
- Users=()
- #### Check script is run as root ####
- if [[ $EUID -ne 0 ]]; then
- echo "This script must be run as root"
- exit 1
- fi
- #### Install zenity (used for GUI) ####
- sudo apt-get install -y zenity
- #### Set admin username ####
- while [[ "$Valid" -eq "0" && "$Quit" -eq "0" && "AdminSet" -eq "0" ]]; do
- Admin=$(zenity --text "Enter the primary admin username" --entry)
- retval=$?
- case $retval in
- 0)
- TestValidUsername $Admin
- if [ "$NotValidUser" -eq "0" ]; then
- UserExist $Admin
- fi
- if [[ "$Valid" -eq "1" && "$NotValidUser" -eq "0" ]]; then
- AdminSet=1
- Valid=0
- fi;;
- 1)
- Quit=1
- echo "Cancel pressed."
- Cancel $Quit;;
- esac
- done
- #### Select and set what to install ####
- if [ "$AdminSet" -eq "1" ]; then
- Options=$(zenity --list --text="Choose what you want to install" --checklist --column="Pick" --column="Options" \
- TRUE "Apache" \
- FALSE "Jackett" \
- FALSE "NextCloud (Requires apache)" \
- TRUE "Plex" \
- TURE "Raid Card (rr278x)"\
- FALSE "Sonarr" \
- TRUE "Samba" \
- FALSE "Transmission" \
- TRUE "VNC"\
- --separator=":");
- if [ "$?" -eq "1" ]; then
- Quit=1
- Cancel $Quit
- fi
- fi
- InstallWhat
- if [ "InstallTransmission" -eq "1" ]; then
- #### Create the admin user ####
- echo -e "Creating $Admin user"
- while [ "$AdminPassSet" -eq "0" ]; do
- temp1=$(zenity --forms --title="Password" --text="Please set a password for admin" --add-password="Password")
- temp2=$(zenity --forms --title="Password" --text="Please confirm password for admin" --add-password="Password")
- if [ "$temp1" == "$temp2" ]; then
- echo "Passwords Match"
- AdminPassSet=1
- else
- echo "Paswords Dont Match"
- AdminPassSet=0
- fi
- done
- echo -e "$AdminPass\n$AdminPass\n\n\n\n\n\nY\n" | sudo adduser $Admin
- #### Set aditional users ####
- AdditionalUsers=$(zenity --question --text="Would you like to create additional users?"; echo $?)
- if [ "$AdditionalUsers" -eq "0" ]; then
- while [[ "$Valid" -eq "0" && "$Quit" -eq "0" ]]; do
- User=$(zenity --text "Enter the aditional users, username" --entry)
- retval=$?
- case $retval in
- 0)
- TestValidUsername $User
- if [ "$NotValidUser" -eq "0" ]; then
- UserExist $User
- fi
- if [[ "$Valid" -eq "1" && "$NotValidUser" -eq "0" ]]; then
- Users+=($User)
- Valid=0
- fi;;
- 1)
- j=$(zenity --question --text="Finished adding users?"; echo $?)
- if [ "$j" -eq "0" ]; then
- Quit=1
- fi;;
- esac
- done
- fi
- #### Add all additional users ###
- for i in "${Users[@]}"; do
- echo -e "Creating $i user"
- echo -e '\n\n\n\n\nY\n' | sudo adduser --disabled-password $i
- done
- echo -e "All users created"
- #### Install curl ####
- sudo apt-get install -y curl
- sudo apt-get upgrade
- #### Restart apache ####
- sudo systemctl restart apache2.service
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement