add trans-ctl functions
This commit is contained in:
parent
26d2596cda
commit
5d90a60e1a
2
crawl.py
2
crawl.py
|
@ -56,5 +56,5 @@ time.sleep(1)
|
||||||
ID = subprocess.Popen(["./trans-ctl.sh -l | grep -vE 'Sum:|ID Done' | tail -n1 | awk '{ print $1 }'"], shell=True, executable="/bin/bash", stdout=subprocess.PIPE).communicate()[0].strip().decode('ascii')
|
ID = subprocess.Popen(["./trans-ctl.sh -l | grep -vE 'Sum:|ID Done' | tail -n1 | awk '{ print $1 }'"], shell=True, executable="/bin/bash", stdout=subprocess.PIPE).communicate()[0].strip().decode('ascii')
|
||||||
print("Wait 10 seconds to get peers before remove tracker...")
|
print("Wait 10 seconds to get peers before remove tracker...")
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
subprocess.call(["./trans-ctl.sh", "-t", ID, "--tracker-remove", "http://ygg.peer2peer.cc:8080"])
|
subprocess.call(["./trans-ctl.sh", "rmtracker", ID])
|
||||||
print("Done")
|
print("Done")
|
||||||
|
|
17
trans-ctl.sh
17
trans-ctl.sh
|
@ -3,4 +3,19 @@
|
||||||
[[ -z $transPwd ]] && transPwd=$(grep "transPwd" login.py | awk -F '=' '{ print $2 }' | tr -d '"' | tr -d ' ')
|
[[ -z $transPwd ]] && transPwd=$(grep "transPwd" login.py | awk -F '=' '{ print $2 }' | tr -d '"' | tr -d ' ')
|
||||||
|
|
||||||
#transmission-remote -t all --auth $transUser:$transPwd "$@"
|
#transmission-remote -t all --auth $transUser:$transPwd "$@"
|
||||||
transmission-remote --auth $transUser:$transPwd "$@"
|
|
||||||
|
case "$1" in
|
||||||
|
rmtracker)
|
||||||
|
transmission-remote --auth $transUser:$transPwd -t $2 --tracker-remove http://ygg.peer2peer.cc:8080
|
||||||
|
;;
|
||||||
|
list)
|
||||||
|
transmission-remote --auth $transUser:$transPwd --list
|
||||||
|
;;
|
||||||
|
getid)
|
||||||
|
transmission-remote --auth $transUser:$transPwd --list | grep -vE 'Sum:|ID Done' | grep -i "${@:2}" | awk '{ print $1 }'
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
cmd="$@"
|
||||||
|
transmission-remote --auth $transUser:$transPwd "$cmd"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
Loading…
Reference in New Issue