Skip to content

Latest commit

 

History

History
74 lines (54 loc) · 2.01 KB

README.md

File metadata and controls

74 lines (54 loc) · 2.01 KB

OpenFire cli

Some simple command line utilities for OpenFire unix server

About

This scripts provide:

  • simple start/stop/restart/status command line interface
  • list registered users/check if user exist/add/delete command line interface

Installation

  • 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 to Secret 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

Usage

  • 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

of-cli-uapi

list users

  • of-cli-uapi list
  • lists all registered users

get user

  • of-cli-uapi get USERNAME
    • e.g. of-cli-uapi get admin
  • if user exists return true, if not exist, return false

add user

  • of-cli-uapi add USERNAME PASS
    • e.g. of-cli-uapi add bobby sup3rs3cur3pass
  • create user with provided credentials

delete user

  • of-cli-uapi delete USERNAME
    • e.g. of-cli-uapi delete bobby
  • delete user with provided username

ToDo

  • add #"email":"$" to reg data
  • add header response code checks
  • add check for right api key

License

  • 2016, lgg
  • MIT