View Single Post
  #301  
Old 10.02.2018, 20:21
RPH
Guest
 
Posts: n/a
Question

Hi, I am running a Pi2 with Ubuntu Mate 16.04 and JDownloader headless. How can I go about making the following work using event scripter:

Event: when download controller starts
Code:
*if files exist in folder /home/myuser/myfolder*
then "killall transmission-gtk" #This is a Linux command normally run in terminal
*end*
Event: when download starts
Code:
"killall transmission-gtk"
Event: when download controller stops
Code:
call home/myuser/myscript.sh
"transmission-gtk %U -m" #must only run after myscript.sh has finished
The contents of myscript.sh is as follows:
Code:
#!/bin/bash

for i in /home/myuser/myfolder/*.mp4
do
/usr/local/bin/gdrive upload --delete "$i" #uploads file to google drive and then deletes it from disk
done
Any help is appreciated, thanks !
Reply With Quote