Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/VibeDevelopers/Comet.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546#!/bin/sh
set -eu
SOURCE="$1": ${DESTDIR:=/}OUTPUT="${DESTDIR%/}/${2#/}"
echo "Writing help indexes to $OUTPUT from $SOURCE"
USERS_INDEX="$OUTPUT/users/index"OPERS_INDEX="$OUTPUT/opers/index"
# Build users indexmkdir -p "$OUTPUT/users/"rm -f "$USERS_INDEX.tmp"for help in "$SOURCE/users/"*; do if [ -f "$help" ]; then basename "$help" >> "$USERS_INDEX.tmp" fidone
# Add symlinks to users indexfor link in topic accept admin names links away whowas version kick who invite quit join list nick oper part time credits motd userhost users whois ison lusers user help pass error challenge knock ping pong map trace chantrace extban monitor batch; do echo "$link" >> "$USERS_INDEX.tmp"done
echo 'Help topics available to users:' > "$USERS_INDEX"echo '' >> "$USERS_INDEX"cat "$USERS_INDEX.tmp" | sed -e 's|^users/||' | sort -u | tr a-z A-Z | column -c 65 -x | expand >> "$USERS_INDEX"rm -f "$USERS_INDEX.tmp"
# Build opers indexmkdir -p "$OUTPUT/opers/"rm -f "$OPERS_INDEX.tmp"for help in "$SOURCE/opers/"*; do if [ -f "$help" ]; then basename $help >> "$OPERS_INDEX.tmp" fidone
echo 'Help topics available to opers:' > "$OPERS_INDEX"echo '' >> "$OPERS_INDEX"cat "$OPERS_INDEX.tmp" | sed -e 's|^opers/||' | sort -u | tr a-z A-Z | column -c 65 -s ' ' -x | expand >> "$OPERS_INDEX"rm -f "$OPERS_INDEX.tmp"