remove until loop

This commit is contained in:
Joe 2019-12-26 15:56:43 -06:00
parent f2827470be
commit bfff245079
Signed by: joe
GPG Key ID: 8595A3F8F2CE1B74
1 changed files with 1 additions and 8 deletions

9
matrix-synapse_purge-remote-media.sh Normal file → Executable file
View File

@ -9,16 +9,9 @@ UserInput() {
ExecutePurge() {
echo 'Purging remote media, please wait.'
UntilLoop "https://$1/_synapse/admin/v1/purge_media_cache?before_ts=$2&access_token=$3" "error"
echo 'Error encountered. Please try again.'
curl -X POST "https://$1/_synapse/admin/v1/purge_media_cache?before_ts=$2&access_token=$3" --data '{}'
}
UntilLoop() {
until curl -X POST "$1" --data '{}' \
grep -m 1 "$2"; do
sleep 1
done
}
UnixTimeMs() {
unix_time_ms="$(($(date -d "$1" +'%s') * 1000))"