Uploaded image for project: 'FreeNAS / TrueNAS'
  1. FreeNAS / TrueNAS
  2. NAS-101873

Fix bug in custom-upssched-cmd

    XMLWordPrintable

    Details

      Description

      Hi,

      the script /usr/local/bin/custom-upssched-cmd has an error on line 32:

      32                 if [ -n $(upsc $ident | grep "ups.status.*OL") ]; then
      33                         logger -t upssched-cmd "Shutdown not initiated as ups.status indicates ${ident} is ONLINE (OL)"
      34                 else
      35                         logger -t upssched-cmd "issuing shutdown"
      36                         /usr/local/sbin/upsmon -c fsd
      37                 fi
      

      This  supposed to test if the UPS is ONLINE and then issue a shutdown if not but the "-n" in line 32 inverts the logic. Removing the "-n" fixes this.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              waqar Waqar Ahmed
              Reporter:
              markusro Markus Rosenstihl
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Summary Panel