install.sh icon indicating copy to clipboard operation
install.sh copied to clipboard

Change the PORT number rocketchat.service parsing

Open cordeosdev opened this issue 2 years ago • 0 comments

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]+')

cordeosdev avatar Dec 03 '22 06:12 cordeosdev