Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions rocketchatctl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ OPTIONS
upgrade-rocketchatctl Upgrade the rocketchatctl command line tool
configure Configures RocketChat server and Let's Encrypt
backup Makes a rocketchat database backup
info Display Instance statistics in Json readable format
To exectute this, you have to create Personal Access Token for the admin user first [https://docs.rocket.chat/api/rest-api/personal-access-tokens]

FOR UNATTENDED INSTALLATION
--root-url=ROOT_URL the public URL where RocketChat server will be accessible on the Internet (REQUIRED)
Expand Down Expand Up @@ -1233,6 +1235,18 @@ main() {
check_arguments_backup $@
do_backup
;;
info)
echo "Any doubts with Access Token and UserID, run 'rocketchatctl help' command first"
read -p "Enter the Access Token admin user:" token
read -p "Enter admin UserID:" userid
if systemctl status rocketchat > /dev/null 2>&1; then
PORT=$(cat /lib/systemd/system/rocketchat.service |grep PORT |awk -F= '{print $3}')

curl -s -H "X-Auth-Token: ${token}" -H "X-User-Id: ${userid}" http://localhost:$PORT/api/v1/statistics | python -m json.tool
else
print_rocketchat_not_running_error_and_exit
fi
;;
*)
show_help
exit 2
Expand Down