Skip to content

Instantly share code, notes, and snippets.

@UnknownEntity634
Created January 5, 2012 02:25
Show Gist options
  • Save UnknownEntity634/1563391 to your computer and use it in GitHub Desktop.
Save UnknownEntity634/1563391 to your computer and use it in GitHub Desktop.
Anope <= 1.8.x Deploy Script Cross-Section
#!/usr/bin/env ruby
dp = open('anope/data/services.conf') {|f| f.read }
matches = dp.scan(/^Mysql(.*)\w* "(.*?)"(.*)$/i)
zbot = dp.scan(/^zbotsql(.*)\w* "(.*?)"(.*)$/i)
# Tried (.*)\w* ((\d*)|("(.*?)"))(.*)$ to no avail
matches.each do |var|
puts var[0] + ' - ' + var[1]
end
puts ' -----------------'
zbot.each do |var|
puts var[0] + ' - ' + var[1]
end
=begin
Sample config go!
Comment lines should be ignored already.
MysqlHost "localhost"
MysqlUser "username"
MysqlPass "password"
MysqlName "dbname"
MysqlSock "/var/lib/mysql/mysql.sock"
MysqlPort "3306"
#MysqlSecure "md5"
#MysqlRetries 10
#MysqlRetryGap 1
#UseRDB
#zbotsqldb "nomatchdb"
#zbotsqluser "nomatchuser"
#zbotsqlpass "nomatchpass"
zbotsqldb "database"
zbotsqluser "user"
zbotsqlpass "password"
zbotsqlhost "localhost"
zbotsqlport 3306
zbotsqlsock "/var/lib/mysql/mysql.sock" #"/var/run/mysqld/mysqld.sock"
zbotUseChanPrivmsg 1
#zbotUseNickPrivmsg 1
zbotFPChannelTime "1"
zbotFPUserTime "1"
ZbotUseFlatDB 0
=end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment