diff --git a/rel/files/emqttd_ctl.bk b/rel/files/emqttd_ctl.bk deleted file mode 100644 index 606562e88..000000000 --- a/rel/files/emqttd_ctl.bk +++ /dev/null @@ -1,300 +0,0 @@ -# Check the first argument for instructions -case "$1" in - status) - if [ $# -ne 1 ]; then - echo "Usage: $SCRIPT status" - exit 1 - fi - - RES=`$NODETOOL ping` - if [ "$RES" != "pong" ]; then - echo "Node is not running!" - exit 1 - fi - shift - - $NODETOOL rpc emqttd_ctl status $@ - ;; - - cluster) - if [ $# -gt 2 ]; then - echo "Usage: $SCRIPT cluster []" - exit 1 - fi - - # Make sure the local node IS running - RES=`$NODETOOL ping` - if [ "$RES" != "pong" ]; then - echo "emqttd is not running!" - exit 1 - fi - shift - - $NODETOOL rpc emqttd_ctl cluster $@ - ;; - - useradd) - if [ $# -ne 3 ]; then - echo "Usage: $SCRIPT useradd " - exit 1 - fi - - # Make sure the local node IS running - RES=`$NODETOOL ping` - if [ "$RES" != "pong" ]; then - echo "emqttd is not running!" - exit 1 - fi - shift - - $NODETOOL rpc emqttd_ctl useradd $@ - ;; - - userdel) - if [ $# -ne 2 ]; then - echo "Usage: $SCRIPT userdel " - exit 1 - fi - - # Make sure the local node IS running - RES=`$NODETOOL ping` - if [ "$RES" != "pong" ]; then - echo "emqttd is not running!" - exit 1 - fi - shift - - $NODETOOL rpc emqttd_ctl userdel $@ - ;; - - vm) - if [ $# -gt 2 ]; then - echo "Usage: $SCRIPT vm [ load | memory | process | io ]" - exit 1 - fi - - # Make sure the local node IS running - RES=`$NODETOOL ping` - if [ "$RES" != "pong" ]; then - echo "emqttd is not running!" - exit 1 - fi - shift - - $NODETOOL rpc emqttd_ctl vm $@ - ;; - - broker) - if [ $# -ne 1 ]; then - echo "Usage: $SCRIPT broker" - exit 1 - fi - - # Make sure the local node IS running - RES=`$NODETOOL ping` - if [ "$RES" != "pong" ]; then - echo "emqttd is not running!" - exit 1 - fi - shift - - $NODETOOL rpc emqttd_ctl broker $@ - ;; - - stats) - if [ $# -ne 1 ]; then - echo "Usage: $SCRIPT stats" - exit 1 - fi - - # Make sure the local node IS running - RES=`$NODETOOL ping` - if [ "$RES" != "pong" ]; then - echo "emqttd is not running!" - exit 1 - fi - shift - - $NODETOOL rpc emqttd_ctl stats $@ - ;; - - metrics) - if [ $# -ne 1 ]; then - echo "Usage: $SCRIPT metrics" - exit 1 - fi - - # Make sure the local node IS running - RES=`$NODETOOL ping` - if [ "$RES" != "pong" ]; then - echo "emqttd is not running!" - exit 1 - fi - shift - - $NODETOOL rpc emqttd_ctl metrics $@ - ;; - - bridges) - # Make sure the local node IS running - RES=`$NODETOOL ping` - if [ "$RES" != "pong" ]; then - echo "emqttd is not running!" - exit 1 - fi - if [[ $# -eq 2 ]] && [[ $2 = "list" ]]; then - $NODETOOL rpc emqttd_ctl bridges list - elif [[ $# -eq 2 ]] && [[ $2 = "options" ]]; then - $NODETOOL rpc emqttd_ctl bridges options - elif [[ $# -eq 4 ]] && [[ $2 = "stop" ]]; then - shift - $NODETOOL rpc emqttd_ctl bridges $@ - elif [[ $# -ge 4 ]] && [[ $2 = "start" ]]; then - shift - $NODETOOL rpc emqttd_ctl bridges $@ - else - echo "Usage: " - echo "$SCRIPT bridges list" - echo "$SCRIPT bridges start " - echo "$SCRIPT bridges start " - echo "$SCRIPT bridges stop " - exit 1 - fi - ;; - clients) - # Make sure the local node IS running - RES=`$NODETOOL ping` - if [ "$RES" != "pong" ]; then - echo "emqttd is not running!" - exit 1 - fi - if [ $# -eq 2 -a $2 = "list" ]; then - $NODETOOL rpc emqttd_ctl clients list - elif [ $# -eq 3 ]; then - shift - $NODETOOL rpc emqttd_ctl clients $@ - else - echo "Usage: " - echo "$SCRIPT clients list" - echo "$SCRIPT clients show " - echo "$SCRIPT clients kick " - exit 1 - fi - ;; - sessions) - # Make sure the local node IS running - RES=`$NODETOOL ping` - if [ "$RES" != "pong" ]; then - echo "emqttd is not running!" - exit 1 - fi - if [ $# -eq 2 -a $2 = "list" ]; then - $NODETOOL rpc emqttd_ctl sessions list - elif [ $# -eq 3 ]; then - shift - $NODETOOL rpc emqttd_ctl sessions $@ - else - echo "Usage: " - echo "$SCRIPT sessions list" - echo "$SCRIPT sessions show " - exit 1 - fi - ;; - plugins) - # Make sure the local node IS running - RES=`$NODETOOL ping` - if [ "$RES" != "pong" ]; then - echo "emqttd is not running!" - exit 1 - fi - if [ $# -eq 2 -a $2 = "list" ]; then - $NODETOOL rpc emqttd_ctl plugins list - elif [ $# -eq 3 ]; then - shift - $NODETOOL rpc emqttd_ctl plugins $@ - else - echo "Usage: " - echo "$SCRIPT plugins list" - echo "$SCRIPT plugins load " - echo "$SCRIPT plugins unload " - exit 1 - fi - ;; - listeners) - if [ $# -gt 1 ]; then - echo "Usage: $SCRIPT listeners" - exit 1 - fi - # Make sure the local node IS running - RES=`$NODETOOL ping` - if [ "$RES" != "pong" ]; then - echo "emqttd is not running!" - exit 1 - fi - shift - - $NODETOOL rpc emqttd_ctl listeners $@ - ;; - trace) - # Make sure the local node IS running - RES=`$NODETOOL ping` - if [ "$RES" != "pong" ]; then - echo "emqttd is not running!" - exit 1 - fi - if [ $# -eq 2 -a $2 = "list" ]; then - $NODETOOL rpc emqttd_ctl trace list - elif [ $# -eq 4 ]; then - shift - $NODETOOL rpc emqttd_ctl trace $@ - else - echo "Usage: " - echo "$SCRIPT trace list" - echo "$SCRIPT trace client " - echo "$SCRIPT trace client off" - echo "$SCRIPT trace topic " - echo "$SCRIPT trace topic off" - exit 1 - fi - ;; - - *) - echo "Usage: $SCRIPT" - echo " status #query broker status" - echo " vm [ load | memory | process | io ] #query load, memory, process and io of erlang vm" - echo " broker #query broker version, uptime and description" - echo " stats #query broker statistics of clients, topics, subscribers" - echo " metrics #query broker metrics" - echo " cluster [] #query or cluster nodes" - echo " ----------------------------------------------------------------" - echo " clients list #list all clients" - echo " clients show #show a client" - echo " clients kick #kick a client" - echo " sessions list #list all sessions" - echo " sessions show #show a sessions" - echo " ----------------------------------------------------------------" - echo " plugins list #query loaded plugins" - echo " plugins load #load plugin" - echo " plugins unload #unload plugin" - echo " ----------------------------------------------------------------" - echo " bridges list #query bridges" - echo " bridges options #bridge options" - echo " bridges start #start bridge" - echo " bridges start #start bridge with options" - echo " bridges stop #stop bridge" - echo " ----------------------------------------------------------------" - echo " useradd #add user" - echo " userdel #delete user" - echo " ----------------------------------------------------------------" - echo " listeners #query broker listeners" - echo " ----------------------------------------------------------------" - echo " trace list #query all traces" - echo " trace client #trace client with ClientId" - echo " trace client off #stop to trace client" - echo " trace topic #trace topic with Topic" - echo " trace topic off #stop to trace Topic" - exit 1 - ;; - -esac -