/usr/share/nanoblogger-extra/plugins/fortune.sh is in nanoblogger-extra 3.4.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | # NanoBlogger Fortune plugin, requires the fortune program.
# sample code for templates, based off default stylesheet
#
# <div class="sidetitle">
# Random Fortune
# </div>
#
# <div class="side">
# $NB_Fortune
# </div>
# Fortune command, use "-s" for short fortunes
: ${FORTUNE_CMD:=/usr/games/fortune -s}
PLUGIN_OUTFILE="$BLOG_DIR/$PARTS_DIR/fortune.$NB_FILETYPE"
if nb_eval "$FORTUNE_CMD"; then
nb_msg "$plugins_action fortune ..."
echo '<div class="fortune">' > "$PLUGIN_OUTFILE"
$FORTUNE_CMD ${FORTUNE_FILE} \
|sed -e '/[\<]/ s//\</g; /[\>]/ s//\>/g; /^$/ s//<br \/>/g; /$/ s//<br \/>/g; /[\$]/ s//\$/g' \
>> "$PLUGIN_OUTFILE"
echo '</div>' >> "$PLUGIN_OUTFILE"
NB_Fortune=$(< "$PLUGIN_OUTFILE")
fi
|