#!/bin/bash [ "$HOSTNAME" != lime2 ] || exit 1 cp ./procedures-tssr/index.template.html ./procedures-tssr/index.tmp.html for folder in ~/tssr/procedures/*; do if [ -d "$folder" ]; then name=$(basename "$folder") if [[ "$name" = *chose* ]]; then # ignore procedure_chose echo ignoring "$name" else echo found "$name" cp "$folder"/procedure*.pdf ./procedures-tssr/procedure_"$name".pdf sed -i "s@===LIST===@
  • procedure_${name}.pdf

  • \n===LIST===@g" ./procedures-tssr/index.tmp.html fi fi done sed -i "s/===LIST===//g" ./procedures-tssr/index.tmp.html cp ./procedures-tssr/index.tmp.html ./procedures-tssr/index.html && rm ./procedures-tssr/index.tmp.html exit 0