add move-to option
This commit is contained in:
parent
b31ef80ec1
commit
0a841fde3d
1 changed files with 9 additions and 0 deletions
|
@ -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}}"
|
||||
|
|
Loading…
Reference in a new issue