19 lines
403 B
Bash
19 lines
403 B
Bash
#!/bin/sh
|
||
|
||
set -eu
|
||
|
||
base="$(dirname "$(readlink -f "$0")")"
|
||
|
||
config="$(sed -rn '/^\[daemon]$/,/´[[^]]+]/p' "$base"/config.ini)"
|
||
queuedir="$(echo "$config" | grep '^queue' | sed -r 's/^.+= *//')"
|
||
|
||
cd "$queuedir"
|
||
for item in *; do
|
||
type="$(jq -r '.type' "$item")"
|
||
if ! [ "$type" = "mediasite" ]; then
|
||
files="$(jq -r '.data.base' "$item")"
|
||
rm -r "$files"
|
||
fi
|
||
rm "$item"
|
||
done
|