Some simple command line utilities for OpenFire unix server
This scripts provide:
- simple
start/stop/restart/status
command line interface list registered users/check if user exist/add/delete
command line interface- only if REST API plugin installed
- you will need jq
sudo apt-get install jq
- if you want check/add/delete users you will need
- REST API plugin
- also enable it in
admin panel->server->server settings->REST API
and set AUTH type toSecret key auth
- cd to e.g.
/usr/src/
- clone this repo
git clone https://github.com/lgg/openfire-cli && cd openfire-cli
- edit
of-cli-uapi
- change apiKey for your REST API AUTH key
- change apiPort if needed
- change apiHost if needed
- copy scripts to
/usr/sbin/
sudo cp ./of-cli /usr/sbin/ && sudo cp ./of-cli-uapi /usr/sbin/
- add execution rights
sudo chmod +x /usr/sbin/of-cli && sudo chmod +x /usr/sbin/of-cli-uapi
- enjoy
of-cli status
- commands: start/status/stop/restart/force-reload
of-cli-uapi get admin
- usage:
of-cli-uapi ACTION USERNAME PASSWORD
- actions: list/get/add/delete
- usage:
of-cli-uapi list
- lists all registered users
of-cli-uapi get USERNAME
- e.g.
of-cli-uapi get admin
- e.g.
- if user exists return
true
, if not exist, returnfalse
of-cli-uapi add USERNAME PASS
- e.g.
of-cli-uapi add bobby sup3rs3cur3pass
- e.g.
- create user with provided credentials
of-cli-uapi delete USERNAME
- e.g.
of-cli-uapi delete bobby
- e.g.
- delete user with provided username
- add #"email":"$" to reg data
- add header response code checks
- add check for right api key
- 2016, lgg
- MIT