xssbook2/build/stamp.sh

15 lines
365 B
Bash
Raw Normal View History

2024-12-20 09:15:58 +00:00
#!/bin/sh
out="./src/web/stamp.php"
public="./src/public"
files=$(find "$public" -type f -printf %P\\n)
printf "<?php\n\$__stamps = array();\n" > "$out"
for file in $files; do
stamp=$(date +%s -r "$public/$file")
echo "\$__stamps['public/$file'] = $stamp;" >> "$out";
done
echo "define('FILE_TIMES', \$__stamps);" >> "$out"
echo "unset(\$__stamps);" >> "$out"