swx_gopher 470 B

123456789101112131415161718192021222324252627
  1. #!/bin/sh
  2. IDIR="$(echo $1 | sed -e 's,/*$,,')"
  3. if [ -z "$IDIR" ] || [ ! -d $IDIR ]; then
  4. echo "swx - version $VERSION"
  5. echo "Usage: $0 [dir]"
  6. exit 1
  7. fi
  8. . $PWD/swx.conf
  9. # Setup output dir structure
  10. CDIR=$PWD
  11. ODIR="$CDIR/$(basename $IDIR).gopher"
  12. mkdir -p $ODIR
  13. cp -uv $IDIR/* $ODIR/
  14. find $ODIR -iname "*$EXT" -exec txt2tags -t txt '{}' \;
  15. find $ODIR -iname "*$EXT" -exec rm '{}' \;
  16. figlet "$TITLE" > "$ODIR"/gophermap
  17. echo "\n*" >> "$ODIR"/gophermap
  18. exit 0