aboutsummaryrefslogtreecommitdiff
path: root/contrib/kiss-message
blob: 8b82c866cbae6669987c9c21d1cf3a01e430fb55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
# Show messages from a package in the system database

case "$1" in ''|--help|-h) printf '\033[1;33m-> \033[m%s\n' "usage: ${0##*/} [pkg] [pkg]"; exit 0; esac

for pkg do
    # Apply basename stripping so a user could run
    # 'kiss-message /var/db/kiss/installed/*' to see
    # all the messages on the system.
    pkg=${pkg##*/}
    msg="$KISS_ROOT/var/db/kiss/installed/$pkg/message"

    # Continue if no messages are available for the package.
    [ -f "$msg" ] || continue

    printf '%s\n\033[1m%s\033[m\n%s\n\n' \
           "==============================" \
           "$pkg" \
           "=============================="
    cat "$msg"
done