Created
October 11, 2013 16:20
-
-
Save Heavyblade/6937697 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' | |
def start | |
Net::SSH.start(ENV["IP"], ENV["USUARIO"], :password => ENV["PASSWORD"], :compression => "zlib") do |session| | |
if ENV["SET_STATUS"] == "start" | |
session.exec! "./directorio_vserver/vServer.sh -s" | |
elsif ENV["SET_STATUS"] == "stop" | |
session.exec! "./directorio_vserver/vServer.sh -t" | |
end | |
end | |
end | |
# ============ Instalar Ruby ================= | |
#Instalando Ruby | |
#apt-get install ruby1.9.1 ruby1.9.1-dev | |
#apt-get install libxslt-dev libxml2-dev | |
#gem install net-ssh | |
# ============= Modo de Uso ================== | |
#./script_vserver IP=127.0.0.1 USUARIO=pedro PASSWORD=perez SET_STATUS=start | |
#./script_vserver IP=127.0.0.1 USUARIO=pedro PASSWORD=perez SET_STATUS=stop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment