SMK  v0.0.1-2561
Simple Message Keeper
Usage

SMK is a single binary with multiple commands and optional parameters.

Command Parameters Example Description
reset   smk reset Erase all previous messages.
clean   smk clean Keep only a few recent messages.
unique <priority> <text> smk unique 2 "Device has rebooted." Add a new message. If an existing similar message already exist, will remove the old message. Priority is 0=high, 1=medium, 2=low, anything else is other.
add <priority> <text> smk add 3 "Service will restart." Add or update a message. If an existing similar message already exist, will incrememnt the duplicate message counter. Priority is 0=high, 1=medium, 2=low, anything else is other.
del <id>|<text> smk del reboot Erase an existing message. The ID is 1-based. If instead text is given, then all messages with partial word match will be removed.
get <id>|all|recent smk get recent Display a tab-delimited set of messages. The ID is 1-based.
show   smk show Format all messages for console display.
dump   smk dump Show the raw json file.

A cron job is automatically installed to regularly clean up the message file, as well as perform some checks when the device reboots. See /etc/cron.d/smk for details.

By adding a call to "smk show" in ~/.bashrc or /etc/profile.d/, messages can easily be shown immediately upon login. This screenshot also shows a customizable banner message from ccr_user in BBTools.

smk.png