diff --git a/files/process_motion_event.sh b/files/process_motion_event.sh index 620dc36..c1ca841 100644 --- a/files/process_motion_event.sh +++ b/files/process_motion_event.sh @@ -6,6 +6,7 @@ test -e /var/lib/from_repos/scripts/shared_functions.sh && source /var/lib/from_ remove_picture=false signal_alert=false mail_alert=false +move_to='' data="\"date\": \"$(date +%s)\"" while [ $# -gt 0 ] @@ -163,6 +164,11 @@ do shift mail_alert=true ;; + "--move-to"|"-M") + shift + move_to="${1}" + shift + ;; *) ;; esac @@ -171,6 +177,9 @@ done if [ -n "${file}" ]; then file_uri=$(echo "${file}" | sed 's|/srv/expendable_data|https://ficheros.koti.site|g') data="${data}, \"file_uri\": \"${file_uri}\"" + if [ -n "${move_to}" ]; then + scp "${file}" "${move_to}/" && rm -rf "${file}" + fi fi data="{${data}}"