Loading ...
Sorry, an error occurred while loading the content.
 

fortune

Expand Messages
  • nhiebaum
    Hi, I am new to Nano Blog, and I have troubles with the fortune plugin. In the config I put this: # Fortune plugin should use fortunes from this file.
    Message 1 of 5 , Dec 2, 2004
      Hi,

      I am new to Nano Blog, and I have troubles with the fortune plugin. In
      the config I put this:

      # Fortune plugin should use fortunes from this file.
      FORTUNE_FILE="fortune.sh"

      And when I finish the configuration, I get this.

      generating fortune ...
      /usr/share/games/fortune/fortune.sh: No such file or directory

      The directory exists, but indeed there is no file fortune.sh there. I
      use OpenBSD 3.6.

      Thanks,
      Nick
    • Brian Reichert
      ... I m fairly new myself and I did just what you tried. That line though is actually to have fortune look to a different file than it would be default I
      Message 2 of 5 , Dec 2, 2004
        On Thu, Dec 02, 2004 at 08:52:43AM -0000, nhiebaum wrote:
        >
        >
        > Hi,
        >
        > I am new to Nano Blog, and I have troubles with the fortune plugin. In
        > the config I put this:
        >
        > # Fortune plugin should use fortunes from this file.
        > FORTUNE_FILE="fortune.sh"
        >
        > And when I finish the configuration, I get this.
        >
        > generating fortune ...
        > /usr/share/games/fortune/fortune.sh: No such file or directory
        >
        > The directory exists, but indeed there is no file fortune.sh there. I
        > use OpenBSD 3.6.
        >
        > Thanks,
        > Nick

        I'm fairly new myself and I did just what you tried. That line though is
        actually to have fortune look to a different file than it would be default I
        believe. I just left mine blank and inserted:

        <div class="sidetitle">
        Random Fortune
        </div>

        <div class="side">
        $NB_Fortune
        </div>

        Where I wanted the fortune to be in my [blog_dir]/templates/main_index.htm.

        I also modified fortune.sh because it seemed to insert spaces, odd characters,
        and carriage returns in strange places. I made it look like this minus the
        comments:

        : ${FORTUNE_CMD:=fortune -s}

        PLUGIN_OUTFILE="$BLOG_DIR/$PARTS_DIR/fortune.$NB_FILETYPE"

        if $FORTUNE_CMD > "$PLUGIN_OUTFILE" 2>&1; then
        nb_msg "generating fortune ..."
        $FORTUNE_CMD ${FORTUNE_FILE} > "$PLUGIN_OUTFILE"
        NB_Fortune="$(<$PLUGIN_OUTFILE)"
        fi

        That was is. Home this helps some.

        Brian
      • nhiebaum
        ... Well, it doesn t work because I don t see a way of either changing the path where nb looks for fortune or because this file fortune.sh does not exist in
        Message 3 of 5 , Dec 2, 2004
          --- In nanoblogger@yahoogroups.com, Brian Reichert <rignes@p...>
          wrote:
          > > generating fortune ...
          > > /usr/share/games/fortune/fortune.sh: No such file or directory
          > >
          >
          > I also modified fortune.sh because it seemed to insert spaces,

          Well, it doesn't work because I don't see a way of either changing the
          path where nb looks for fortune or because this file fortune.sh does
          not exist in the directory in question.

          Nick
        • Brian Reichert
          ... Hmm, strange. I didn t have to tell nb where to find fortune.sh or anything. I took a look at fortune.sh and as long as fortune itself is somewhere in
          Message 4 of 5 , Dec 2, 2004
            On Thu, Dec 02, 2004 at 06:24:17PM -0000, nhiebaum wrote:
            >
            >
            > --- In nanoblogger@yahoogroups.com, Brian Reichert <rignes@p...>
            > wrote:
            > > > generating fortune ...
            > > > /usr/share/games/fortune/fortune.sh: No such file or directory
            > > >
            > >
            > > I also modified fortune.sh because it seemed to insert spaces,
            >
            > Well, it doesn't work because I don't see a way of either changing the
            > path where nb looks for fortune or because this file fortune.sh does
            > not exist in the directory in question.
            >
            > Nick

            Hmm, strange. I didn't have to tell nb where to find fortune.sh or anything.
            I took a look at fortune.sh and as long as fortune itself is somewhere in your
            path, /usr/games/fortune in my case I'd think it should run. The way I read
            it, and I may be wrong, is that the line in fortune.sh that it runs just after
            giving the message of "generating fortune ...":

            $FORTUNE_CMD ${FORTUNE_FILE} > "$PLUGIN_OUTFILE"

            This expands out to just running "fortune -s" and put it in the variable
            $NB_Fortune. I made the mistake when I first tried it of setting FORTUNE_FILE
            to where I thought fortune was in my blog.conf which is wrong since that would
            try to make fortune use whatever you put in that variable as it's source for
            fortunes. Once I set FORTUNE_FILE="" it worked fine for me. So for instance,
            if you put /var/share/games/fortune/fortune.sh" in the FORTUNE_FILE variable in
            blog.conf it would try to run:

            fortune -s /var/share/games/fortune/fortune.sh

            instead of just

            fortune -s

            If you run fortune -s at a command prompt do you get a fortune?

            Brian
          • Kevin W.
            Hi Nick, I can see how this can be confusing, so I ll explain it here. The fortune.sh plugin has two configurable variables: 1. FORTUNE_CMD 2. FORTUNE_FILE In
            Message 5 of 5 , Dec 2, 2004
              Hi Nick,

              I can see how this can be confusing, so I'll explain
              it here.

              The fortune.sh plugin has two configurable variables:
              1. FORTUNE_CMD
              2. FORTUNE_FILE

              In the first, you can specify the fortune command. In
              the second, you can specify the fortune database file
              to be used. If the fortune command is not in your path
              you might want to include it in FORTUNE_CMD. e.g.
              FORTUNE_CMD="/usr/games/fortune" and
              FORTUNE_FILE="startrek"

              Kevin
              --- nhiebaum <nhiebaum@...> wrote:

              >
              > Hi,
              >
              > I am new to Nano Blog, and I have troubles with the
              > fortune plugin. In
              > the config I put this:
              >
              > # Fortune plugin should use fortunes from this file.
              > FORTUNE_FILE="fortune.sh"
              >
              > And when I finish the configuration, I get this.
              >
              > generating fortune ...
              > /usr/share/games/fortune/fortune.sh: No such file or
              > directory
              >
              > The directory exists, but indeed there is no file
              > fortune.sh there. I
              > use OpenBSD 3.6.
              >
              > Thanks,
              > Nick
              >
              >
              >
              >


              __________________________________________________
              Do You Yahoo!?
              Tired of spam? Yahoo! Mail has the best spam protection around
              http://mail.yahoo.com
            Your message has been successfully submitted and would be delivered to recipients shortly.