You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
494 B
13 lines
494 B
#!/usr/local/bin/ruby
|
|
config = File.new("db.rb", "w")
|
|
config.print("require 'mysql'\n")
|
|
print "hostname: "
|
|
hostname = gets
|
|
print "username: "
|
|
username = gets
|
|
print "password: "
|
|
password = gets
|
|
print "dbname: "
|
|
dbname = gets
|
|
config.print("begin\nraise 'DB Error' unless $my = Mysql.connect('" + hostname.strip + "', '" + username.strip + "', '" + password.strip + "', '" + dbname.strip + "')\n")
|
|
config.print("rescue\nprint 'Please double check db settings or contact the administrator'\nend")
|
|
|