AtOM/lib/setup/regen
2013-06-27 21:08:30 +02:00

29 lines
591 B
Bash

#!/bin/bash
setupRegen() {
(( regen )) && return 0
echo "Parameter $1 for destination $destination changed."
read -p'Regenerate all files? [y/n] '
case $REPLY in
y)
regen=1
openDatabase
if forcedestid=$(Select destinations id <<<"name = $destination")
then
echo "Resetting destination files timestamps on" \
"$destination ($forcedestid)..."
Update destination_files last_change 0 \
<<<"destination_id = $forcedestid"
else
echo "Destination $destination does not exist!" >&2
fi
closeDatabase
;;
n)
;;
*)
setupRegen $1
;;
esac
}