1# An admin sets the home page's motd over ssh: motd <text> sets it (trimmed,2# escaped on the page) and rebuilds the index, motd prints it, --clear3# hides the line, --default brings the default back. The operator's forge4# motd does the same, and backups carry it.5. "$(dirname "$0")/../lib.sh"6user cat7repo cat/notes8git config --file "$FORGE_ROOT/.gitconfig" forge.admins cat9export FORGE_STRICT=110build11i=$FORGE_WWW/index.html12has "$i" '<p class="motd">a personal forge on plain git</p>'13ok ssh_as cat motd14eq "$(output)" "a personal forge on plain git15(the default; motd <text> sets another)"1617sync_builds18ok ssh_as cat motd ' notes <b>&</b> things '19has "$T_LOG" '^the home page says: notes <b>&</b> things$'20has "$i" '<p class="motd">notes <b>&</b> things</p>'21ok ssh_as cat motd22eq "$(output)" 'notes <b>&</b> things'23ok forge backup --dry-run24has "$FORGE_ROOT/.forge/backup/stage/.forge/motd" '^notes <b>&</b> things$'2526ok ssh_as cat motd --clear27lacks "$i" 'class="motd"'28ok ssh_as cat motd29eq "$(output)" "(none: the home page shows no line; motd <text> sets one)"3031ok forge motd "on the server"32has "$i" '<p class="motd">on the server</p>'33ok forge motd --default34has "$i" '<p class="motd">a personal forge on plain git</p>'35missing "$FORGE_ROOT/.forge/motd"36fails_with '^forge: usage: motd \[<text>\|--clear\|--default\]$' ssh_as cat motd --clear now