-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdebian-transmission.sh
81 lines (71 loc) · 2.09 KB
/
debian-transmission.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
# http://dadi.me/ dadi.ME
# 2013.03.30
# Transmission | Debian
# VERSION CHOICE
ver="latest"
echo "Which version(latest OR stable) do you want to install:"
read -p "Type latest or stable (latest):" ver
if [ "$ver" = "" ]; then
ver="latest"
fi
# CONFIGURATION
username=""
read -p "Set username(qnmlgdsb):" username
if [ "$username" = "" ]; then
username="qnmlgdsb"
fi
password=""
read -p "Set password(qnmlgdsb):" password
if [ "$password" = "" ]; then
password="qnmlgdsb"
fi
port=""
read -p "Set port(1989):" port
if [ "$port" = "" ]; then
port="1989"
fi
get_char()
{
SAVEDSTTY=`stty -g`
stty -echo
stty cbreak
dd if=/dev/tty bs=1 count=1 2> /dev/null
stty -raw
stty echo
stty $SAVEDSTTY
}
echo ""
echo "Press any key to start...or Press Ctrl+c to cancel"
char=`get_char`
# START
if [ "$ver" = "latest" ]; then
echo "deb http://ftp.debian.org/debian/ sid main" >> /etc/apt/sources.list
echo "deb http://ftp.debian.org/debian/ experimental main" >> /etc/apt/sources.list
apt-get update
apt-get -t experimental install transmission-daemon -y
echo "APT::Default-Release \"stable\";" >> /etc/apt/apt.conf.d/71distro
else
apt-get update
apt-get -y install transmission-daemon
fi
# SETTINGS.JSON
/etc/init.d/transmission-daemon stop
# wget http://dadi.me/wp-content/uploads/dir/Transmission/settings.json
wget https://raw.githubusercontent.com/qnmlgdsb/tr/master/settings.json
mv -f settings.json /var/lib/transmission-daemon/info/
sed -i 's/^.*rpc-username.*/"rpc-username": "'$(echo $username)'",/' /var/lib/transmission-daemon/info/settings.json
sed -i 's/^.*rpc-password.*/"rpc-password": "'$(echo $password)'",/' /var/lib/transmission-daemon/info/settings.json
sed -i 's/^.*rpc-port.*/"rpc-port": '$(echo $port)',/' /var/lib/transmission-daemon/info/settings.json
/etc/init.d/transmission-daemon start
mkdir -p /home/transmission/Downloads/
chmod -R 777 /home/transmission/Downloads/
# END
clear
echo "Done."
echo " "
echo "Web GUI: http://your ip:$port/"
echo "username: $username"
echo "password: $password"