Skip to content

Change the PORT number rocketchat.service parsing #71

Open

Description

@cordeosdev

The parsing of PORT# from the rocketchat.service systemd file often fails. The GREP/AWK used for this terribly fragile and will only work if the service environment variable EXACTLY matches what it is expecting.

This often results in the dreaded UNARY operator error.
*basically meaning either current or latest version of Rocket.Chat returned NULL

This problem can easily be avoided by using a more flexible parse strategy which will pull the port number no matter where or how it is located in the environment= line...

Line 741 change from:
PORT=$(cat /lib/systemd/system/rocketchat.service | grep PORT= | awk -FPORT= '{print $3}')
to
PORT=$(cat /lib/systemd/system/rocketchat.service | grep PORT= | grep -Po 'PORT=\s*\K[0-9]+')

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions