Sha256: 0368310c2378b59bbe24bfd0037bdeed743e11251623c4413c0f74c1f78f2d1b

Contents?: true

Size: 1016 Bytes

Versions: 45

Compression:

Stored size: 1016 Bytes

Contents

#!/usr/bin/env ruby
#Unset Connection Script
#@author Aldo

require 'logger'
require 'rest_client'

path = "/var/log/ejabberd/scripts.log"
file = File.open(path, File::WRONLY | File::APPEND | File::CREAT)
file.sync = true
$logger = Logger.new(file)
$logger.level = Logger::DEBUG

def getOption(option)
  File.open('/etc/ejabberd/ssconfig.cfg', 'r') do |f1|  
    while line = f1.gets  
      line = line.gsub(/\n/,'')
      if line.match(/^#/)
        #Comments
      elsif line.match(/^#{option}/)
        return line.gsub(/#{option}/,'')
      end  
    end  
  end
  return "Undefined"
end

$url = getOption("unset_connection_api=")
$pass = getOption("ejabberd_password=")


def log(text)
	$logger.info "Unset Connection: " + text
end

def unsetConnection(username)
  log("unsetConnection(#{username})")
  RestClient.post($url, :name => username, :password => $pass)
  return true

  rescue RestClient::Exception
    log("RestClient::Exception with unsetConnection(#{username})")
end


unsetConnection(ARGV[0])


Version data entries

45 entries across 45 versions & 2 rubygems

Version Path
social_stream-0.13.3 presence/ejabberd/ejabberd_scripts/unset_connection_script
social_stream-0.13.2 presence/ejabberd/ejabberd_scripts/unset_connection_script
social_stream-0.13.1 presence/ejabberd/ejabberd_scripts/unset_connection_script
social_stream-presence-0.1.2 ejabberd/ejabberd_scripts/unset_connection_script
social_stream-0.13.0 presence/ejabberd/ejabberd_scripts/unset_connection_script
social_stream-presence-0.1.1 ejabberd/ejabberd_scripts/unset_connection_script
social_stream-0.12.14 presence/ejabberd/ejabberd_scripts/unset_connection_script
social_stream-0.12.13 presence/ejabberd/ejabberd_scripts/unset_connection_script
social_stream-0.12.12 presence/ejabberd/ejabberd_scripts/unset_connection_script
social_stream-presence-0.1.0 ejabberd/ejabberd_scripts/unset_connection_script
social_stream-0.12.11 presence/ejabberd/ejabberd_scripts/unset_connection_script
social_stream-0.12.10 presence/ejabberd/ejabberd_scripts/unset_connection_script
social_stream-0.12.9 presence/ejabberd/ejabberd_scripts/unset_connection_script
social_stream-0.12.8 presence/ejabberd/ejabberd_scripts/unset_connection_script
social_stream-0.12.7 presence/ejabberd/ejabberd_scripts/unset_connection_script
social_stream-0.12.6 presence/ejabberd/ejabberd_scripts/unset_connection_script
social_stream-0.12.5 presence/ejabberd/ejabberd_scripts/unset_connection_script
social_stream-presence-0.0.21 ejabberd/ejabberd_scripts/unset_connection_script
social_stream-0.12.4 presence/ejabberd/ejabberd_scripts/unset_connection_script
social_stream-0.12.3 presence/ejabberd/ejabberd_scripts/unset_connection_script