Created
October 12, 2013 01:17
-
-
Save Heavyblade/6944458 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'net/ssh' | |
Net::SSH.start(ENV["IP"], ENV["USUARIO"], :password => ENV["PASSWORD"], :compression => "zlib") do |session| | |
if ENV["SET_STATUS"] == "start" | |
puts session.exec! "cd /path_a_tu_vserver/VelneoV7-vServer; sudo ./vServer.sh -s" | |
elsif ENV["SET_STATUS"] == "stop" | |
puts session.exec! "cd /path_a_tu_vserver/VelneoV7-vServer; sudo ./vServer.sh -t" | |
end | |
session.loop | |
end | |
# ============ Instalar Ruby ================= | |
# Instalando Ruby | |
# apt-get update | |
# apt-get install ruby1.9.1 ruby1.9.1-dev | |
# apt-get install libxslt-dev libxml2-dev | |
# gem install net-ssh | |
# ============= Modo de Uso ================== | |
# IP=127.0.0.1 USUARIO=xxxxx PASSWORD=yyyy SET_STATUS=start ./script | |
# IP=127.0.0.1 USUARIO=xxxxx PASSWORD=yyyy SET_STATUS=stop ./script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment