mirror of
https://github.com/elisspace/rtinst.git
synced 2026-10-07 09:28:35 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
16ddfa0325 |
@@ -47,6 +47,15 @@ Services that will be installed and configured are
|
|||||||
|
|
||||||
[Additional information on all the features](https://github.com/arakasi72/rtinst/wiki/Guide)
|
[Additional information on all the features](https://github.com/arakasi72/rtinst/wiki/Guide)
|
||||||
|
|
||||||
|
For older unssuported OS [Older OS Installation Guide](https://github.com/arakasi72/rtinst/wiki/Installing-on-Older-OS). These include:
|
||||||
|
|
||||||
|
Ubuntu 12 (old release)
|
||||||
|
Ubuntu 13 (old release)
|
||||||
|
Ubuntu 14 (old release)
|
||||||
|
Ubuntu 15 (old release)
|
||||||
|
Debian 7 "Wheezy" (old release)
|
||||||
|
Debian 8 "Jessie" (old release)
|
||||||
|
|
||||||
To see latest updates to the script go to [Change Log](https://github.com/arakasi72/rtinst/wiki/Change-Log)
|
To see latest updates to the script go to [Change Log](https://github.com/arakasi72/rtinst/wiki/Change-Log)
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|||||||
+8
-14
@@ -182,10 +182,10 @@ echo $ip_address
|
|||||||
PATH=/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/bin:/sbin
|
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
|
# 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.8'
|
rtorrentrel='0.9.6'
|
||||||
|
|
||||||
#url's of the major components
|
#url's of the major components
|
||||||
rt_url="https://rakshasa.github.io/rtorrent/"
|
rt_url="http://rtorrent.net/downloads/"
|
||||||
|
|
||||||
xmlrpc_url="https://svn.code.sf.net/p/xmlrpc-c/code/advanced/"
|
xmlrpc_url="https://svn.code.sf.net/p/xmlrpc-c/code/advanced/"
|
||||||
xmlrpc_url_alt="https://github.com/mirror/xmlrpc-c"
|
xmlrpc_url_alt="https://github.com/mirror/xmlrpc-c"
|
||||||
@@ -199,11 +199,11 @@ if [ $(dpkg-query -W -f='${Status}' lsb-release 2>/dev/null | grep -c "ok instal
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
fullrel=$(lsb_release -sd)
|
fullrel=$(lsb_release -sd)
|
||||||
osname=$(lsb_release -si); osname=${osname^}
|
osname=$(lsb_release -si)
|
||||||
relno=$(lsb_release -sr | cut -d. -f1)
|
relno=$(lsb_release -sr | cut -d. -f1)
|
||||||
|
|
||||||
# Fallback if lsb_release -si returns anything else than Ubuntu, Debian or Raspbian
|
# Fallback if lsb_release -si returns anything else than Ubuntu, Debian or Raspbian
|
||||||
if [ ! "$osname" = "Ubuntu" ] && [ ! "$osname" = "Debian" ] && [ ! "$osname" = "Raspbian" ]; then
|
if [ ! "$osname" = "ubuntu" ] && [ ! "$osname" = "debian" ] && [ ! "$osname" = "raspbian" ] && [ ! "$osname" = "Linuxmint" ]; then
|
||||||
osname=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"')
|
osname=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"')
|
||||||
osname=${osname^}
|
osname=${osname^}
|
||||||
fi
|
fi
|
||||||
@@ -243,12 +243,6 @@ if [ "$relno" = "20" ] || [ "$(lsb_release -sr)" = "20.04" ] || [ "$relno" = "11
|
|||||||
libcver=libcurl4
|
libcver=libcurl4
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$relno" = "21" ] || [ "$(lsb_release -sr)" = "21.04" ]; then
|
|
||||||
phpver=php7.4
|
|
||||||
phploc=/etc/php/7.4
|
|
||||||
libcver=libcurl4
|
|
||||||
fi
|
|
||||||
|
|
||||||
serveripa=$(ip route get 8.8.8.8 | awk 'NR==1 {print $7}')
|
serveripa=$(ip route get 8.8.8.8 | awk 'NR==1 {print $7}')
|
||||||
serveripb=$(wget -qO- --timeout=3 ipecho.net/plain)
|
serveripb=$(wget -qO- --timeout=3 ipecho.net/plain)
|
||||||
serveripc=$(wget -qO- --timeout=3 ipinfo.io/ip)
|
serveripc=$(wget -qO- --timeout=3 ipinfo.io/ip)
|
||||||
@@ -307,11 +301,11 @@ if [ "$(id -u)" != "0" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# determine system
|
# determine system
|
||||||
if ([ "$osname" = "Ubuntu" ] && [ $relno -ge 16 ]) || ([ "$osname" = "Debian" ] && [ $relno -ge 9 ]) || ([ "$osname" = "Raspbian" ] && [ $relno -ge 9 ]); then
|
if ([ "$osname" = "Ubuntu" ] && [ $relno -ge 16 ]) || ([ "$osname" = "Debian" ] && [ $relno -ge 9 ]) || ([ "$osname" = "Raspbian" ] && [ $relno -ge 9 ]) || ([ "$osname" = "Linuxmint" ] && [ $relno -ge 16 ]); then
|
||||||
echo $fullrel
|
echo $fullrel
|
||||||
else
|
else
|
||||||
echo $fullrel
|
echo $fullrel
|
||||||
echo "Only Ubuntu release 16 and later, and Debian and Raspbian release 9 and later, are supported"
|
echo "Only Ubuntu and Linux Mint release 16 and later, and Debian and Raspbian release 9 and later, are supported"
|
||||||
echo "Your system does not appear to be supported"
|
echo "Your system does not appear to be supported"
|
||||||
echo "Check https://github.com/arakasi72/rtinst/wiki/Installing-on-Older-OS to see if it is supported by an earlier rtinst release"
|
echo "Check https://github.com/arakasi72/rtinst/wiki/Installing-on-Older-OS to see if it is supported by an earlier rtinst release"
|
||||||
exit
|
exit
|
||||||
@@ -557,7 +551,7 @@ echo "Updating package lists" | tee $logfile
|
|||||||
apt-get -qq update | tee -a $logfile
|
apt-get -qq update | tee -a $logfile
|
||||||
|
|
||||||
# Installing Aptitude
|
# Installing Aptitude
|
||||||
apt-get -qqy install aptitude >> $logfile 2>&1
|
apt-get -qqy install aptitude
|
||||||
|
|
||||||
echo "Upgrading packages" | tee -a $logfile
|
echo "Upgrading packages" | tee -a $logfile
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
@@ -619,7 +613,7 @@ if [ $osname = "Debian" ] && ! installed unrar; then
|
|||||||
cp $home/rar/unrar /bin/unrar
|
cp $home/rar/unrar /bin/unrar
|
||||||
rm -r $home/rar
|
rm -r $home/rar
|
||||||
fi
|
fi
|
||||||
elif [ $osname = "Ubuntu" ]; then
|
elif [ $osname = "Ubuntu" || $osname = "Linuxmint" ]; then
|
||||||
aptitude -q=5 -y install unrar >> $logfile 2>&1
|
aptitude -q=5 -y install unrar >> $logfile 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ if [ $osname = "Debian" ]; then snap install core >> $logfile 2>&1; snap refresh
|
|||||||
# Installing Certbot
|
# Installing Certbot
|
||||||
if [ $(snap list | grep -c "certbot") = 0 ]; then
|
if [ $(snap list | grep -c "certbot") = 0 ]; then
|
||||||
echo "Installing certbot"
|
echo "Installing certbot"
|
||||||
snap install --classic certbot >> $logfile 2>&1
|
snap -y install --classic certbot >> $logfile 2>&1
|
||||||
else
|
else
|
||||||
echo "certbot already installed"
|
echo "certbot already installed"
|
||||||
fi
|
fi
|
||||||
@@ -80,8 +80,6 @@ if [ $(snap list | grep -c "certbot") = 0 ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#Prepare certbot command
|
|
||||||
ln -s /snap/bin/certbot /usr/bin/certbot
|
|
||||||
|
|
||||||
#Generating Certificates
|
#Generating Certificates
|
||||||
certbot -q --nginx --register-unsafely-without-email --agree-tos certonly -d $serverdn >> $logfile 2>&1
|
certbot -q --nginx --register-unsafely-without-email --agree-tos certonly -d $serverdn >> $logfile 2>&1
|
||||||
|
|||||||
+75
-11
@@ -30,7 +30,7 @@ if [ "$fullrelno" = "" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
sourcedir='https://rakshasa.github.io/rtorrent/'
|
sourcedir='http://rtorrent.net/downloads/'
|
||||||
|
|
||||||
xmlrpc_url='https://svn.code.sf.net/p/xmlrpc-c/code/stable/'
|
xmlrpc_url='https://svn.code.sf.net/p/xmlrpc-c/code/stable/'
|
||||||
xmlrpcloc='svn://svn.code.sf.net/p/xmlrpc-c/code/stable/'
|
xmlrpcloc='svn://svn.code.sf.net/p/xmlrpc-c/code/stable/'
|
||||||
@@ -40,13 +40,33 @@ xmlrpcloc_alt='https://github.com/mirror/xmlrpc-c/trunk/stable'
|
|||||||
|
|
||||||
rtdevrel=1
|
rtdevrel=1
|
||||||
|
|
||||||
libvers='0.13.8'
|
if [ "$fullrelno" = "17.10" ]; then
|
||||||
rtvers='0.9.8'
|
rtdevrel=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ([ "$osname" = "Debian" ] || [ "$osname" = "Raspbian" ] && [ $relno -ge 9 ]) || ([ "$osname" = "Ubuntu" ] && [ $relno -ge 18 ]) || ([ "$osname" = "Linuxmint" ] && [ $relno -ge 18 ]); then
|
||||||
|
rtdevrel=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
listsize=6
|
||||||
duoversion=''
|
duoversion=''
|
||||||
passed_rtvers=$1
|
passed_rtvers=$1
|
||||||
[ -z $logfile ] && logfile="/dev/null"
|
[ -z $logfile ] && logfile="/dev/null"
|
||||||
|
|
||||||
|
# get a list of the most recent releases
|
||||||
|
rt_releases=$(wget -q -O - $sourcedir | grep -o "rtorrent-[0-9]\{1,2\}\.[0-9]\{1,2\}\.[0-9]\{1,2\}\.tar.gz" | sort -uV | tail -$listsize | grep -o "[0-9]\{1,2\}\.[0-9]\{1,2\}\.[0-9]\{1,2\}")
|
||||||
|
|
||||||
|
# extract the release numbers from the list of most recent releases
|
||||||
|
for rtversion in $rt_releases
|
||||||
|
do
|
||||||
|
libversion=$(echo $rtversion | awk -F. -v OFS=. '{$2='$(( $(echo $rtversion | cut -d. -f2) + 4 ))'; print }')
|
||||||
|
duoversion="$duoversion $libversion/$rtversion"
|
||||||
|
done
|
||||||
|
|
||||||
|
# get the most recent release version number
|
||||||
|
latest_duo=$(echo $duoversion | rev | cut -d' ' -f1 | rev)
|
||||||
|
latest_libvers=$(echo $latest_duo | cut -d/ -f1)
|
||||||
|
latest_rtvers=$(echo $latest_duo | cut -d/ -f2)
|
||||||
|
|
||||||
# checks if an application is installed
|
# checks if an application is installed
|
||||||
installed() {
|
installed() {
|
||||||
@@ -58,6 +78,20 @@ check_url() {
|
|||||||
if [[ `wget -S -T 3 --spider $1 2>&1 | grep 'HTTP/1.1 200 OK'` ]]; then return 0; else return 1; fi
|
if [[ `wget -S -T 3 --spider $1 2>&1 | grep 'HTTP/1.1 200 OK'` ]]; then return 0; else return 1; fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# function to create a list of versions to install
|
||||||
|
list_version() {
|
||||||
|
local verschoice
|
||||||
|
while [ -z "$verschoice" ]
|
||||||
|
do
|
||||||
|
echo "Please select libtorrent/rtorrent version."
|
||||||
|
select verschoice in ${duoversion[*]}
|
||||||
|
do
|
||||||
|
libvers=$(echo $verschoice | cut -d/ -f1)
|
||||||
|
rtvers=$(echo $verschoice | cut -d/ -f2)
|
||||||
|
break
|
||||||
|
done
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
ask_user(){
|
ask_user(){
|
||||||
local answer
|
local answer
|
||||||
@@ -115,14 +149,45 @@ if [ -z $passed_rtvers ]; then
|
|||||||
if ( installed rtorrent ); then
|
if ( installed rtorrent ); then
|
||||||
rt_current=$(rtorrent -h | grep -om 1 "[0-9]\{1,2\}\.[0-9]\{1,2\}\.[0-9]\{1,2\}")
|
rt_current=$(rtorrent -h | grep -om 1 "[0-9]\{1,2\}\.[0-9]\{1,2\}\.[0-9]\{1,2\}")
|
||||||
echo "rtorrent $rt_current detected"
|
echo "rtorrent $rt_current detected"
|
||||||
exit 1
|
|
||||||
else
|
else
|
||||||
echo "rtorrent NOT installed"
|
echo "rtorrent NOT installed"
|
||||||
echo "This script is for upgrading/downgrading only, not for initial install"
|
echo "This script is for upgrading/downgrading only, not for initial install"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
|
# checks if the OS is debian 9, and forces the version to 0.9.7 of it is
|
||||||
|
if [ $rtdevrel = 0 ]; then
|
||||||
|
echo "For Debian 9, Ubuntu 17.10 or later and Linux Mint 17 or later, libtorrent-0.13.7/rtorrent-0.9.7 or later is recommended"
|
||||||
|
fi
|
||||||
|
|
||||||
|
list_version
|
||||||
|
|
||||||
|
echo "Install libtorrent-$libvers and rtorrent-$rtvers"
|
||||||
|
echo "Your rtorrent config, torrents, and data will not be lost or changed"
|
||||||
|
echo -n "Continue? "
|
||||||
|
if ! ask_user; then
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [ "$passed_rtvers" = "latest" ] || [ $(wget -q -O - $sourcedir | grep -o "rtorrent-$passed_rtvers.tar.gz" | wc -l) -eq 0 ]; then
|
||||||
|
if [ "$passed_rtvers" != "latest" ]; then
|
||||||
|
echo " Could not find $passed_rtvers so using latest version instead"
|
||||||
|
fi
|
||||||
|
libvers=$latest_libvers
|
||||||
|
rtvers=$latest_rtvers
|
||||||
|
else
|
||||||
|
libvers=$(echo $passed_rtvers | awk -F. -v OFS=. '{$2='$(( $(echo $rtversion | cut -d. -f2) + 4 ))'; print }')
|
||||||
|
rtvers=$passed_rtvers
|
||||||
|
fi
|
||||||
|
|
||||||
|
# checks if the OS is debian 9, and forces the version to 0.9.7 of it is
|
||||||
|
if [ $rtdevrel = 0 ]; then
|
||||||
|
libvers='0.13.8'
|
||||||
|
rtvers='0.9.8'
|
||||||
|
echo "Debian 9, Ubuntu 17.10 or later and Linux Mint 17 or later are only supported by libtorrent-0.13.7/rtorrent-0.9.7 or later"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$home" ]; then
|
if [ -z "$home" ]; then
|
||||||
home=$HOME
|
home=$HOME
|
||||||
@@ -142,14 +207,13 @@ rm -rf xmlrpc libtorrent* rtorrent*
|
|||||||
|
|
||||||
echo "Fetching source files"
|
echo "Fetching source files"
|
||||||
|
|
||||||
|
|
||||||
#if [ $rtdevrel = 0 ]; then
|
#if [ $rtdevrel = 0 ]; then
|
||||||
# git clone -q -b feature-bind --single-branch https://github.com/rakshasa/libtorrent.git libtorrent-$libvers
|
# git clone -q -b feature-bind --single-branch https://github.com/rakshasa/libtorrent.git libtorrent-$libvers
|
||||||
# git clone -q -b feature-bind --single-branch https://github.com/rakshasa/rtorrent.git rtorrent-$rtvers
|
# git clone -q -b feature-bind --single-branch https://github.com/rakshasa/rtorrent.git rtorrent-$rtvers
|
||||||
#else
|
#else
|
||||||
curl -LOJ# https://github.com/rakshasa/rtorrent-archive/raw/master/libtorrent-$libvers.tar.gz
|
curl -# http://rtorrent.net/downloads/libtorrent-$libvers.tar.gz | tar xz
|
||||||
tar -xzf libtorrent-$libvers.tar.gz
|
curl -# http://rtorrent.net/downloads/rtorrent-$rtvers.tar.gz | tar xz
|
||||||
curl -LOJ# https://github.com/rakshasa/rtorrent-archive/raw/master/rtorrent-$rtvers.tar.gz
|
|
||||||
tar -xzf rtorrent-$rtvers.tar.gz
|
|
||||||
#fi
|
#fi
|
||||||
|
|
||||||
if [ $xmlrpc_repo = 0 ]; then
|
if [ $xmlrpc_repo = 0 ]; then
|
||||||
@@ -166,7 +230,7 @@ if [ $xmlrpc_repo = 0 ]; then
|
|||||||
cd $home/source
|
cd $home/source
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd libtorrent-$libvers
|
cd libtorrent*
|
||||||
echo "Installing libtorrent" | tee -a $logfile
|
echo "Installing libtorrent" | tee -a $logfile
|
||||||
./autogen.sh >> $logfile 2>&1
|
./autogen.sh >> $logfile 2>&1
|
||||||
if [ $osname = "Raspbian" ]; then
|
if [ $osname = "Raspbian" ]; then
|
||||||
@@ -177,7 +241,7 @@ fi
|
|||||||
make -j$(nproc) >> $logfile 2>&1
|
make -j$(nproc) >> $logfile 2>&1
|
||||||
make -s install >> $logfile 2>&1
|
make -s install >> $logfile 2>&1
|
||||||
|
|
||||||
cd ../rtorrent-$rtvers
|
cd ../rtorrent*
|
||||||
echo "Installing rtorrent" | tee -a $logfile
|
echo "Installing rtorrent" | tee -a $logfile
|
||||||
./autogen.sh >> $logfile 2>&1
|
./autogen.sh >> $logfile 2>&1
|
||||||
./configure --prefix=/usr --with-xmlrpc-c --enable-ipv6 >> $logfile 2>&1
|
./configure --prefix=/usr --with-xmlrpc-c --enable-ipv6 >> $logfile 2>&1
|
||||||
|
|||||||
Reference in New Issue
Block a user