Download Station 다운로드완료시 push 처리 방법
- 다운로드 완료 후 실행될 스크립트 작성 (예. downloadComplete.sh)
- 메시지 발송 url 및 파라메터는 로켓챗이나 텔레그램 push 방법을 참조바랍니다.
!/bin/sh
URL=”수신url”
function send_message {
res=$(/usr/bin/curl -H “Content-type:application/json” $URL -d “{\”text\”: \”Synology NAS DownloadStation : $TR_TORRENT_NAME download complete.\” }”)
}send_message
/bin/psql -U postgres -d download -c “DELETE FROM Download_queue WHERE status IN (‘5′,’7′,’8’)”
- 쉘 스크립트 권한 변경
- chmod 755 downloadComplete.sh
- download station 중지
- /var/packages/DownloadStation/scripts/start-stop-status 수정
- settings.json 를 삭제하는 부분을 remark 처리 (맨 앞에 # 추가)
- /var/packages/DownloadStation/etc/download/settings.json, /usr/syno/etc/packages/DownloadStation/download/settings.json 수정
- script-torrent-done-enabled 변경 : false -> true
- script-torrent-done-filename 변경 : “” -> “스크립트 경로/downloadComplete.sh”
- /etc/postgresql/pg_hba.conf 수정
- local all postgres peer map=pg_root => trust 로 변경
- postgresql 을 재시작
- /usr/syno/etc.defaults/rc.sysv/pgsql.sh restart