mirror of
https://github.com/elisspace/rtinst.git
synced 2026-10-06 17:16:22 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8d667c6e3 | ||
|
|
9ffbf03938 | ||
|
|
9cf742a0fb | ||
|
|
d66db0d049 | ||
|
|
34833cb5e2 | ||
|
|
86c148966f | ||
|
|
61556b73ea | ||
|
|
67484c6813 | ||
|
|
627b5c25e9 | ||
|
|
bf06620c85 | ||
|
|
0d4ae9b317 | ||
|
|
e13bc2b706 | ||
|
|
f9615fe823 | ||
|
|
14c270f096 | ||
|
|
5452c98799 | ||
|
|
016299230e | ||
|
|
763d2efdeb | ||
|
|
1f1ec0ad3a | ||
|
|
b18b5718fe | ||
|
|
deff019f56 | ||
|
|
11a019cd16 | ||
|
|
0a8b21b8f3 |
@@ -29,6 +29,7 @@ Current release has been tested with clean installs of:
|
||||
Ubuntu 17
|
||||
Ubuntu 18
|
||||
Ubuntu 19
|
||||
Ubuntu 20
|
||||
Debian 9 "Stretch"
|
||||
Debian 10 "Buster"
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ if [ -d /etc/rtinst ] && [ -z $branch ]; then
|
||||
if [ -z $branch ]; then
|
||||
branch=$(git describe --tags --exact-match)
|
||||
if [ ${branch:0:1} = v ]; then
|
||||
latest=$(basename "$(git ls-remote --tags https://github.com/arakasi72/rtinst.git | grep -o 'refs/tags/v.*' | sort -V | tail -1)")
|
||||
latest=$(curl -s "https://api.github.com/repos/arakasi72/rtinst/releases/latest" | awk -F '"' '/tag_name/{print $4}')
|
||||
if [ $branch != $latest ]; then
|
||||
echo "Updating from $branch to $latest"
|
||||
branch=$latest
|
||||
|
||||
+21
-18
@@ -182,10 +182,10 @@ echo $ip_address
|
||||
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'
|
||||
rtorrentrel='0.9.8'
|
||||
|
||||
#url's of the major components
|
||||
rt_url="http://rtorrent.net/downloads/"
|
||||
rt_url="https://rakshasa.github.io/rtorrent/"
|
||||
|
||||
xmlrpc_url="https://svn.code.sf.net/p/xmlrpc-c/code/advanced/"
|
||||
xmlrpc_url_alt="https://github.com/mirror/xmlrpc-c"
|
||||
@@ -194,16 +194,16 @@ 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
|
||||
echo "Installing lsb-release"
|
||||
apt-get -yqq install lsb-release 2>&1 >> /dev/null
|
||||
fi
|
||||
|
||||
fullrel=$(lsb_release -sd)
|
||||
osname=$(lsb_release -si)
|
||||
osname=$(lsb_release -si); osname=${osname^}
|
||||
relno=$(lsb_release -sr | cut -d. -f1)
|
||||
|
||||
# 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" ]; then
|
||||
osname=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"')
|
||||
osname=${osname^}
|
||||
fi
|
||||
@@ -281,7 +281,7 @@ 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 $phpver-zip 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"
|
||||
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 $phpver-zip screen subversion texinfo unzip zlib1g-dev libcurl4-openssl-dev mediainfo software-properties-common $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
|
||||
@@ -550,18 +550,21 @@ fi
|
||||
echo "Updating package lists" | tee $logfile
|
||||
apt-get -qq update | tee -a $logfile
|
||||
|
||||
# Installing Aptitude
|
||||
apt-get -qqy install aptitude >> $logfile 2>&1
|
||||
|
||||
echo "Upgrading packages" | tee -a $logfile
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get -qq upgrade >> $logfile 2>&1
|
||||
aptitude -q=5 -y upgrade >> $logfile 2>&1
|
||||
if ! [ $? = 0 ]; then
|
||||
echo "Problem upgrading packages. Run 'apt-get upgrade' successfully and rerun the script" && exit
|
||||
echo "Problem upgrading packages. Run 'aptitude upgrade' successfully and rerun the script" && exit
|
||||
fi
|
||||
|
||||
apt-get clean && apt-get autoclean >> $logfile 2>&1
|
||||
aptitude clean && aptitude autoclean >> $logfile 2>&1
|
||||
|
||||
#install the packsges needed
|
||||
#install the packages needed
|
||||
echo "Installing required packages" | tee -a $logfile
|
||||
apt-get install libtool -y >> $logfile 2>&1
|
||||
aptitude -q=5 -y install libtool >> $logfile 2>&1
|
||||
for package_name in $package_list
|
||||
do
|
||||
if [ $(apt-cache show -q=0 $package_name 2>&1 | grep -c "No packages found") -eq 0 ]; then
|
||||
@@ -575,16 +578,16 @@ for package_name in $package_list
|
||||
|
||||
# Installs a package needed to prevent arm64 architectures from "WARNING: Unable to start rtorrent"
|
||||
if [ "$(uname --m)" == "aarch64" ] || [ "$(dpkg --print-architecture)" == "arm64" ] ; then
|
||||
sudo apt-get install libxmlrpc-core-c3-dev -y >> $logfile 2>&1
|
||||
aptitude -q=5 -y install libxmlrpc-core-c3-dev >> $logfile 2>&1
|
||||
fi
|
||||
|
||||
test -z "$install_list" || apt-get -qq install $install_list >> $logfile 2>&1
|
||||
test -z "$install_list" || aptitude -q=5 -y install $install_list >> $logfile 2>&1
|
||||
if ! [ $? = 0 ]; then
|
||||
echo "Problem installing packages. Check log and rerun once it is resolved" && exit
|
||||
fi
|
||||
|
||||
if [[ $phpver =~ php7.[0-9] ]]; then
|
||||
apt-get -qq install $phpver-mbstring >> $logfile 2>&1
|
||||
aptitude -q=5 -y install $phpver-mbstring >> $logfile 2>&1
|
||||
fi
|
||||
|
||||
#install unrar package
|
||||
@@ -611,7 +614,7 @@ if [ $osname = "Debian" ] && ! installed unrar; then
|
||||
rm -r $home/rar
|
||||
fi
|
||||
elif [ $osname = "Ubuntu" ]; then
|
||||
apt-get -qq install unrar >> $logfile 2>&1
|
||||
aptitude -q=5 -y install unrar >> $logfile 2>&1
|
||||
fi
|
||||
|
||||
if installed unrar; then
|
||||
@@ -623,7 +626,7 @@ fi
|
||||
#install ffmpeg
|
||||
if ! [ $osname = "Raspbian" ] && [ $(dpkg-query -W -f='${Status}' "ffmpeg" 2>/dev/null | grep -c "ok installed") = 0 ]; then
|
||||
echo "Installing ffmpeg"
|
||||
apt-get -qq install ffmpeg >> $logfile 2>&1
|
||||
aptitude -q=5 -y install ffmpeg >> $logfile 2>&1
|
||||
fi
|
||||
|
||||
echo "Completed installation of required packages "
|
||||
@@ -710,7 +713,7 @@ ftpport=$(random 41005 48995)
|
||||
|
||||
if [ $(dpkg-query -W -f='${Status}' "vsftpd" 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
|
||||
echo "Installing vsftpd" | tee -a $logfile
|
||||
apt-get -y install vsftpd >> $logfile 2>&1
|
||||
aptitude -q=5 -y install vsftpd >> $logfile 2>&1
|
||||
fi
|
||||
|
||||
sed -i '/^\(\s\|#\)*anonymous_enable/ c\anonymous_enable=NO' /etc/vsftpd.conf
|
||||
|
||||
+19
-16
@@ -11,6 +11,8 @@
|
||||
|
||||
headless=0
|
||||
osname=$(lsb_release -si)
|
||||
releasename=$(lsb_release -cs)
|
||||
|
||||
[ -z $logfile ] && logfile="/dev/null"
|
||||
if [ -z $serverip ]; then
|
||||
headless=1
|
||||
@@ -54,31 +56,32 @@ if [ -z $serverdn ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#Installing Certbot
|
||||
if [ $(dpkg-query -W -f='${Status}' "certbot" 2>/dev/null | grep -c "ok installed") = 0 ]; then
|
||||
echo "Installing certbot"
|
||||
# Remove apt version of Certbot if installed
|
||||
if [ $(dpkg-query -W -f='${Status}' "certbot" 2>/dev/null | grep -c "ok installed") = 1 ]; then
|
||||
echo "Removing apt version of Certbot"
|
||||
aptitude -q=5 -y remove certbot python*-certbot-nginx >> $logfile 2>&1
|
||||
fi
|
||||
|
||||
if [ "$osname" = "Ubuntu" ]; then
|
||||
apt-get -q update >> $logfile 2>&1
|
||||
add-apt-repository -y universe >> $logfile 2>&1
|
||||
add-apt-repository -y ppa:certbot/certbot >> $logfile 2>&1
|
||||
apt-get -q update >> $logfile 2>&1
|
||||
apt-get install -y certbot python-certbot-nginx >> $logfile 2>&1
|
||||
else
|
||||
deb_name=$(lsb_release --codename --short)
|
||||
grep "^deb http\:\/\/deb\.debian\.org\/debian $deb_name-backports main" /etc/apt/sources.list > /dev/null || echo "deb http://deb.debian.org/debian $deb_name-backports main" >> /etc/apt/sources.list
|
||||
apt-get -q update >> $logfile 2>&1
|
||||
apt-get install -y certbot python-certbot-nginx -t $deb_name-backports >> $logfile 2>&1
|
||||
fi
|
||||
# Install Snapd service
|
||||
aptitude -q=5 -y install snapd >> $logfile 2>&1
|
||||
# Install the core snap in order to get the latest snapd for Debian
|
||||
if [ $osname = "Debian" ]; then snap install core >> $logfile 2>&1; snap refresh core; fi
|
||||
|
||||
# Installing Certbot
|
||||
if [ $(snap list | grep -c "certbot") = 0 ]; then
|
||||
echo "Installing certbot"
|
||||
snap install --classic certbot >> $logfile 2>&1
|
||||
else
|
||||
echo "certbot already installed"
|
||||
fi
|
||||
|
||||
if [ $(dpkg-query -W -f='${Status}' "certbot" 2>/dev/null | grep -c "ok installed") = 0 ]; then
|
||||
if [ $(snap list | grep -c "certbot") = 0 ]; then
|
||||
echo "Install Failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#Prepare certbot command
|
||||
ln -s /snap/bin/certbot /usr/bin/certbot
|
||||
|
||||
#Generating Certificates
|
||||
certbot -q --nginx --register-unsafely-without-email --agree-tos certonly -d $serverdn >> $logfile 2>&1
|
||||
|
||||
+14
-77
@@ -30,7 +30,7 @@ if [ "$fullrelno" = "" ]; then
|
||||
fi
|
||||
|
||||
|
||||
sourcedir='http://rtorrent.net/downloads/'
|
||||
sourcedir='https://rakshasa.github.io/rtorrent/'
|
||||
|
||||
xmlrpc_url='https://svn.code.sf.net/p/xmlrpc-c/code/stable/'
|
||||
xmlrpcloc='svn://svn.code.sf.net/p/xmlrpc-c/code/stable/'
|
||||
@@ -40,33 +40,13 @@ xmlrpcloc_alt='https://github.com/mirror/xmlrpc-c/trunk/stable'
|
||||
|
||||
rtdevrel=1
|
||||
|
||||
if [ "$fullrelno" = "17.10" ]; then
|
||||
rtdevrel=0
|
||||
fi
|
||||
libvers='0.13.8'
|
||||
rtvers='0.9.8'
|
||||
|
||||
if ([ "$osname" = "Debian" ] || [ "$osname" = "Raspbian" ] && [ $relno -ge 9 ]) || ([ "$osname" = "Ubuntu" ] && [ $relno -ge 18 ]); then
|
||||
rtdevrel=0
|
||||
fi
|
||||
|
||||
listsize=6
|
||||
duoversion=''
|
||||
passed_rtvers=$1
|
||||
[ -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
|
||||
installed() {
|
||||
@@ -78,20 +58,6 @@ check_url() {
|
||||
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(){
|
||||
local answer
|
||||
@@ -149,46 +115,15 @@ if [ -z $passed_rtvers ]; then
|
||||
if ( installed rtorrent ); then
|
||||
rt_current=$(rtorrent -h | grep -om 1 "[0-9]\{1,2\}\.[0-9]\{1,2\}\.[0-9]\{1,2\}")
|
||||
echo "rtorrent $rt_current detected"
|
||||
exit 1
|
||||
else
|
||||
echo "rtorrent NOT installed"
|
||||
echo "This script is for upgrading/downgrading only, not for initial install"
|
||||
exit 1
|
||||
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, and Ubuntu 17.10 and later, recommend libtorrent-0.13.7/rtorrent-0.9.7 or later"
|
||||
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, and Ubuntu 17.10 and later, are only supported by libtorrent-0.13.7/rtorrent-0.9.7 or later"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
|
||||
if [ -z "$home" ]; then
|
||||
home=$HOME
|
||||
fi
|
||||
@@ -207,24 +142,28 @@ rm -rf xmlrpc libtorrent* rtorrent*
|
||||
|
||||
echo "Fetching source files"
|
||||
|
||||
|
||||
#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/rtorrent.git rtorrent-$rtvers
|
||||
#else
|
||||
curl -# http://rtorrent.net/downloads/libtorrent-$libvers.tar.gz | tar xz
|
||||
curl -# http://rtorrent.net/downloads/rtorrent-$rtvers.tar.gz | tar xz
|
||||
curl -LOJ# https://github.com/rakshasa/rtorrent-archive/raw/master/libtorrent-$libvers.tar.gz
|
||||
tar -xzf libtorrent-$libvers.tar.gz
|
||||
curl -LOJ# https://github.com/rakshasa/rtorrent-archive/raw/master/rtorrent-$rtvers.tar.gz
|
||||
tar -xzf rtorrent-$rtvers.tar.gz
|
||||
#fi
|
||||
|
||||
if [ $xmlrpc_repo = 0 ]; then
|
||||
svn co $xmlrpcloc xmlrpc >> $logfile 2>&1
|
||||
if [ ! -e xmlrpc ]; then
|
||||
git clone $xmlrpc_url_alt xmlrpc >> $logfile 2>&1
|
||||
cd xmlrpc/stable
|
||||
else cd xmlrpc; fi
|
||||
|
||||
cd xmlrpc
|
||||
echo "Installing xmlrpc" | tee -a $logfile
|
||||
./configure --prefix=/usr --disable-cplusplus >> $logfile 2>&1
|
||||
make -j$(nproc) >> $logfile 2>&1
|
||||
make -s install >> $logfile 2>&1
|
||||
cd ..
|
||||
cd $home/source
|
||||
fi
|
||||
|
||||
cd libtorrent-$libvers
|
||||
@@ -246,8 +185,6 @@ make -j$(nproc) >> $logfile 2>&1
|
||||
make -s install >> $logfile 2>&1
|
||||
ldconfig >> $logfile 2>&1
|
||||
|
||||
echo "$libvers/$rtvers installed"
|
||||
echo
|
||||
|
||||
if [ -d /var/www/rutorrent/conf/users ]; then
|
||||
cd /var/www/rutorrent/conf/users
|
||||
|
||||
+2
-2
@@ -20,8 +20,8 @@ if [ $(dpkg-query -W -f='${Status}' webmin 2>/dev/null | grep -c "ok installed")
|
||||
echo "Installing Webmin"
|
||||
echo "deb http://download.webmin.com/download/repository sarge contrib" > /etc/apt/sources.list.d/webmin.list
|
||||
wget -qO - http://www.webmin.com/jcameron-key.asc | apt-key add -
|
||||
apt-get -qq update
|
||||
apt-get -qq install webmin
|
||||
aptitude -q=5 update
|
||||
aptitude -q=5 -y install webmin
|
||||
else
|
||||
echo 'Webmin is already installed'
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user