tunuifranken.info/bin/create-index.sh

23 lines
420 B
Bash
Raw Normal View History

2021-01-04 13:53:39 +01:00
#!/bin/bash
2021-03-05 16:18:59 +01:00
# This script is executed by make in the parent directory
2021-09-05 18:26:40 +02:00
main() {
verbose "Updating index.html"
2021-01-04 13:53:39 +01:00
2021-09-05 18:26:40 +02:00
chmod 644 ./index.html
2021-09-05 18:26:40 +02:00
awk -v header="$(<./header.html)" '{sub(/===HEADER===/,header)} 1' ./index.template.html |
awk -v footer="$(<./footer.html)" '{sub(/===FOOTER===/,footer)} 1' > ./index.html
2021-01-05 11:11:51 +01:00
2021-09-05 18:26:40 +02:00
chmod 444 ./index.html
}
verbose() {
if [ "$VERBOSE" = true ]; then
echo "$@"
fi
}
main