Sha256: da16f09b93620ab5efd8cce5d44751d4cda0cc52b593a38faa39e25ce578120f
Contents?: true
Size: 542 Bytes
Versions: 57
Compression:
Stored size: 542 Bytes
Contents
#!/usr/bin/env ruby site = ARGV[0] old_cwd = Dir.pwd Dir.chdir "/etc/apache2/sites-available/" # show available sites if no site was passed as argument unless site puts 'ERROR: Argument site is missing.' puts 'Please call: apache-site my-site' puts puts 'Available sites:' Dir.new(".").each do |file| puts "- #{file}" if file != '.' && file != '..' end exit end has_default = File.exists?("default") exec "sudo a2dissite \*; sudo a2ensite #{"default " if has_default}#{site} && sudo apache2ctl restart" Dir.chdir old_cwd
Version data entries
57 entries across 57 versions & 1 rubygems