16 lines
381 B
Bash
16 lines
381 B
Bash
#!/bin/sh
|
|
set -eu
|
|
|
|
config="/config/script.conf"
|
|
dest="/downloads/completed"
|
|
|
|
if [ -f "${config}" ]; then
|
|
configured_dest="$(awk -F= '$1 == "dest-dir" {print substr($0, index($0, "=") + 1)}' "${config}" | tail -n 1)"
|
|
if [ -n "${configured_dest}" ]; then
|
|
dest="${configured_dest}"
|
|
fi
|
|
fi
|
|
|
|
mkdir -p "${dest}"
|
|
echo "[INFO] Move hook completed. Destination: ${dest}"
|