tunuifranken.info/bin/pull-cours.sh

21 lines
472 B
Bash
Raw Normal View History

#!/bin/bash
2021-03-05 16:18:59 +01:00
# This script is executed by make in the parent directory
[ "$HOSTNAME" != lime2 ] || exit 1
2021-03-12 12:23:00 +01:00
if [ "$VERBOSE" = true ]; then
echo -n "Pulling cours... "
fi
origin_file_time=$(stat -c %Y ~/tssr/cours/cours*.pdf)
current_file_time=$(stat -c %Y ./cours.pdf)
if [ "$origin_file_time" -gt "$current_file_time" ]; then
2021-03-12 12:23:00 +01:00
cp ~/tssr/cours/cours*.pdf ./cours.pdf && echo "Updated cours"
else
2021-03-12 12:23:00 +01:00
if [ "$VERBOSE" = true ]; then
echo "Already up to date"
fi
fi