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
|
remove_picture=false
|
||||||
signal_alert=false
|
signal_alert=false
|
||||||
mail_alert=false
|
mail_alert=false
|
||||||
|
move_to=''
|
||||||
|
|
||||||
data="\"date\": \"$(date +%s)\""
|
data="\"date\": \"$(date +%s)\""
|
||||||
while [ $# -gt 0 ]
|
while [ $# -gt 0 ]
|
||||||
|
@ -163,6 +164,11 @@ do
|
||||||
shift
|
shift
|
||||||
mail_alert=true
|
mail_alert=true
|
||||||
;;
|
;;
|
||||||
|
"--move-to"|"-M")
|
||||||
|
shift
|
||||||
|
move_to="${1}"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -171,6 +177,9 @@ done
|
||||||
if [ -n "${file}" ]; then
|
if [ -n "${file}" ]; then
|
||||||
file_uri=$(echo "${file}" | sed 's|/srv/expendable_data|https://ficheros.koti.site|g')
|
file_uri=$(echo "${file}" | sed 's|/srv/expendable_data|https://ficheros.koti.site|g')
|
||||||
data="${data}, \"file_uri\": \"${file_uri}\""
|
data="${data}, \"file_uri\": \"${file_uri}\""
|
||||||
|
if [ -n "${move_to}" ]; then
|
||||||
|
scp "${file}" "${move_to}/" && rm -rf "${file}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
data="{${data}}"
|
data="{${data}}"
|
||||||
|
|
Loading…
Reference in a new issue