mirror of
https://github.com/elisspace/rtinst.git
synced 2026-08-29 15:44:06 +00:00
Update rtinst
This commit is contained in:
230
scripts/rtinst
230
scripts/rtinst
@@ -8,110 +8,6 @@
|
||||
#
|
||||
#########################################################################################
|
||||
|
||||
###############################
|
||||
### SET VARIABLES ###
|
||||
###############################
|
||||
|
||||
PATH=/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/bin:/sbin
|
||||
|
||||
# if left blank will install latest version of rtorrent, or set to a specific release E.G. '0.9.6' to install that release
|
||||
rtorrentrel='0.9.6'
|
||||
|
||||
#url's of the major components
|
||||
rt_url="http://rtorrent.net/downloads/"
|
||||
|
||||
xmlrpc_url="https://svn.code.sf.net/p/xmlrpc-c/code/advanced/"
|
||||
xmlrpc_url_alt="https://github.com/mirror/xmlrpc-c"
|
||||
|
||||
ru_url="https://github.com/Novik/ruTorrent/"
|
||||
adl_url="https://github.com/autodl-community/"
|
||||
|
||||
if [ $(dpkg-query -W -f='${Status}' lsb-release 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
|
||||
echo "Installing lsb-release"
|
||||
apt-get -yqq install lsb-release 2>&1 >> /dev/null
|
||||
fi
|
||||
|
||||
fullrel=$(lsb_release -sd)
|
||||
osname=$(lsb_release -si)
|
||||
relno=$(lsb_release -sr | cut -d. -f1)
|
||||
|
||||
# Fallback if lsb_release -si returns nothing
|
||||
if [ "$osname" = "" ]; then
|
||||
osname=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"')
|
||||
osname=${osname^}
|
||||
fi
|
||||
|
||||
# Fallback if lsb_release -sr returns nothing
|
||||
if [ "$relno" = "" ]; then
|
||||
relno=$(grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"')
|
||||
fi
|
||||
|
||||
if [ "$relno" = "16" ] || [ "$relno" = "17" ] || [ "$relno" = "9" ]; then
|
||||
phpver=php7.0
|
||||
phploc=/etc/php/7.0
|
||||
libcver=libcurl3
|
||||
fi
|
||||
|
||||
if [ "$(lsb_release -sr)" = "17.10" ]; then
|
||||
phpver=php7.1
|
||||
phploc=/etc/php/7.1
|
||||
libcver=libcurl3
|
||||
fi
|
||||
|
||||
if [ "$relno" = "18" ] || [ "$relno" = "19" ]; then
|
||||
phpver=php7.2
|
||||
phploc=/etc/php/7.2
|
||||
libcver=libcurl4
|
||||
fi
|
||||
|
||||
if [ "$relno" = "10" ]; then
|
||||
phpver=php7.3
|
||||
phploc=/etc/php/7.3
|
||||
libcver=libcurl4
|
||||
fi
|
||||
|
||||
serveripa=$(ip route get 8.8.8.8 | awk 'NR==1 {print $7}')
|
||||
serveripb=$(wget -qO- ipecho.net/plain)
|
||||
|
||||
if [ "$serveripa" = "$serveripb" ]; then
|
||||
serverip=$serveripa
|
||||
else
|
||||
echo "Select the IP address to use:"
|
||||
echo "1.) "$serveripa
|
||||
echo "2.) "$serveripb
|
||||
|
||||
while true
|
||||
do
|
||||
read answer
|
||||
case $answer in [1] ) serverip=$serveripa && break ;;
|
||||
[2] ) serverip=$serveripb && break ;;
|
||||
* ) echo "Enter 1 or 2";;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
echo "IP set to "$serverip
|
||||
|
||||
|
||||
export logfile="/dev/null"
|
||||
webpass=''
|
||||
cronline1="@reboot sleep 10; /usr/local/bin/rtcheck irssi rtorrent"
|
||||
cronline2="*/10 * * * * /usr/local/bin/rtcheck irssi rtorrent"
|
||||
dlflag=1
|
||||
portdefault=1
|
||||
|
||||
skip_rt=1
|
||||
sshport=''
|
||||
rudevflag=1
|
||||
rurelease=master
|
||||
passfile='/etc/nginx/.htpasswd'
|
||||
package_list="sudo nano autoconf build-essential ca-certificates comerr-dev curl dtach htop irssi libcppunit-dev $libcver libncurses5-dev libterm-readline-gnu-perl libsigc++-2.0-dev libperl-dev libtool libxml2-dev ncurses-base ncurses-term ntp patch pkg-config $phpver-fpm $phpver $phpver-cli $phpver-dev $phpver-curl php-geoip $phpver-xmlrpc $phpver-xml python-scgi screen subversion texinfo unzip zlib1g-dev libcurl4-openssl-dev mediainfo software-properties-common aptitude $phpver-json nginx-full apache2-utils git libarchive-zip-perl libnet-ssleay-perl libhtml-parser-perl libxml-libxml-perl libjson-perl libjson-xs-perl libxml-libxslt-perl libjson-rpc-perl libarchive-zip-perl"
|
||||
Install_list=""
|
||||
unixpass=""
|
||||
passflag=0
|
||||
forceyes=1
|
||||
selfsign=1
|
||||
rut_add_users=1
|
||||
|
||||
###############################
|
||||
### FUNCTIONS ###
|
||||
@@ -254,22 +150,138 @@ while true
|
||||
|
||||
# function to enter IP address
|
||||
enter_ip() {
|
||||
local ip_address=$1
|
||||
|
||||
exec 3>&1 >/dev/tty
|
||||
|
||||
while true
|
||||
do
|
||||
if valid_ip $serverip ; then
|
||||
echo "Your Server IP is $serverip"
|
||||
if valid_ip $ip_address ; then
|
||||
echo "Your Server IP is $ip_address"
|
||||
echo -n "Is this correct y/n? "
|
||||
ask_user && return 0
|
||||
ask_user && break
|
||||
else
|
||||
echo "Invalid IP address, please try again"
|
||||
fi
|
||||
|
||||
echo "enter your server's IP address"
|
||||
echo "e.g. 213.0.113.113"
|
||||
read serverip
|
||||
read ip_address
|
||||
done
|
||||
|
||||
exec >&3-
|
||||
|
||||
echo $ip_address
|
||||
}
|
||||
|
||||
|
||||
###############################
|
||||
### SET VARIABLES ###
|
||||
###############################
|
||||
|
||||
PATH=/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/bin:/sbin
|
||||
|
||||
# if left blank will install latest version of rtorrent, or set to a specific release E.G. '0.9.6' to install that release
|
||||
rtorrentrel='0.9.6'
|
||||
|
||||
#url's of the major components
|
||||
rt_url="http://rtorrent.net/downloads/"
|
||||
|
||||
xmlrpc_url="https://svn.code.sf.net/p/xmlrpc-c/code/advanced/"
|
||||
xmlrpc_url_alt="https://github.com/mirror/xmlrpc-c"
|
||||
|
||||
ru_url="https://github.com/Novik/ruTorrent/"
|
||||
adl_url="https://github.com/autodl-community/"
|
||||
|
||||
if [ $(dpkg-query -W -f='${Status}' lsb-release 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
|
||||
echo "Installing lsb-release"
|
||||
apt-get -yqq install lsb-release 2>&1 >> /dev/null
|
||||
fi
|
||||
|
||||
fullrel=$(lsb_release -sd)
|
||||
osname=$(lsb_release -si)
|
||||
relno=$(lsb_release -sr | cut -d. -f1)
|
||||
|
||||
# Fallback if lsb_release -si returns nothing
|
||||
if [ "$osname" = "" ]; then
|
||||
osname=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"')
|
||||
osname=${osname^}
|
||||
fi
|
||||
|
||||
# Fallback if lsb_release -sr returns nothing
|
||||
if [ "$relno" = "" ]; then
|
||||
relno=$(grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"')
|
||||
fi
|
||||
|
||||
if [ "$relno" = "16" ] || [ "$relno" = "17" ] || [ "$relno" = "9" ]; then
|
||||
phpver=php7.0
|
||||
phploc=/etc/php/7.0
|
||||
libcver=libcurl3
|
||||
fi
|
||||
|
||||
if [ "$(lsb_release -sr)" = "17.10" ]; then
|
||||
phpver=php7.1
|
||||
phploc=/etc/php/7.1
|
||||
libcver=libcurl3
|
||||
fi
|
||||
|
||||
if [ "$relno" = "18" ] || [ "$relno" = "19" ]; then
|
||||
phpver=php7.2
|
||||
phploc=/etc/php/7.2
|
||||
libcver=libcurl4
|
||||
fi
|
||||
|
||||
if [ "$relno" = "10" ]; then
|
||||
phpver=php7.3
|
||||
phploc=/etc/php/7.3
|
||||
libcver=libcurl4
|
||||
fi
|
||||
|
||||
serveripa=$(ip route get 8.8.8.8 | awk 'NR==1 {print $7}')
|
||||
serveripb=$(wget -qO- ipecho.net/plain)
|
||||
|
||||
if [ "$serveripa" = "$serveripb" ]; then
|
||||
serverip=$serveripa
|
||||
else
|
||||
echo "Select the IP address to use:"
|
||||
echo "1.) "$serveripa
|
||||
echo "2.) "$serveripb
|
||||
|
||||
while true
|
||||
do
|
||||
read answer
|
||||
case $answer in [1] ) serverip=$serveripa && break ;;
|
||||
[2] ) serverip=$serveripb && break ;;
|
||||
* ) echo "Enter 1 or 2";;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
echo "IP set to "$serverip
|
||||
|
||||
|
||||
export logfile="/dev/null"
|
||||
webpass=''
|
||||
cronline1="@reboot sleep 10; /usr/local/bin/rtcheck irssi rtorrent"
|
||||
cronline2="*/10 * * * * /usr/local/bin/rtcheck irssi rtorrent"
|
||||
dlflag=1
|
||||
portdefault=1
|
||||
|
||||
skip_rt=1
|
||||
sshport=''
|
||||
rudevflag=1
|
||||
rurelease=master
|
||||
passfile='/etc/nginx/.htpasswd'
|
||||
package_list="sudo nano autoconf build-essential ca-certificates comerr-dev curl dtach htop irssi libcppunit-dev $libcver libncurses5-dev libterm-readline-gnu-perl libsigc++-2.0-dev libperl-dev libtool libxml2-dev ncurses-base ncurses-term ntp patch pkg-config $phpver-fpm $phpver $phpver-cli $phpver-dev $phpver-curl php-geoip $phpver-xmlrpc $phpver-xml python-scgi screen subversion texinfo unzip zlib1g-dev libcurl4-openssl-dev mediainfo software-properties-common aptitude $phpver-json nginx-full apache2-utils git libarchive-zip-perl libnet-ssleay-perl libhtml-parser-perl libxml-libxml-perl libjson-perl libjson-xs-perl libxml-libxslt-perl libjson-rpc-perl libarchive-zip-perl"
|
||||
Install_list=""
|
||||
unixpass=""
|
||||
passflag=0
|
||||
forceyes=1
|
||||
selfsign=1
|
||||
rut_add_users=1
|
||||
|
||||
|
||||
|
||||
###############################
|
||||
### INITIAL SYSTEM CHECKS ###
|
||||
###############################
|
||||
@@ -359,7 +371,7 @@ fi
|
||||
echo
|
||||
|
||||
# check IP Address
|
||||
[ $forceyes = 1 ] && enter_ip
|
||||
[ $forceyes = 1 ] && serverip=$(enter_ip $serverip)
|
||||
|
||||
echo "Your server's IP is set to $serverip"
|
||||
export serverip
|
||||
|
||||
Reference in New Issue
Block a user