Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (operatingSystem.ToString().Contains("Ubuntu"))
- {
- try
- {
- using (var client = new SshClient(srvIP, srvUser, srvPassword))
- {
- client.Connect();
- client.RunCommand("cd ~");
- client.RunCommand("git clone " + gitUrl + " build");
- client.RunCommand("cd build && ./autogen.sh && ./configure --with-incompatible-bdb --enable-hardening && make");
- client.RunCommand("cd build && make install");
- client.RunCommand("mkdir " + DataDir);
- client.RunCommand("touch " + DataDir + "/" + ConfigName);
- client.RunCommand("echo server=1 >> " + DataDir + "/" + ConfigName);
- client.RunCommand("echo listen=1 >> " + DataDir + "/" + ConfigName);
- client.RunCommand("echo daemon=1 >> " + DataDir + "/" + ConfigName);
- client.RunCommand("echo rpcallow=" + rpcAllow + " >> " + DataDir + "/" + ConfigName);
- client.RunCommand("echo rpcallowip=" + rpcAllow + " >> " + DataDir + "/" + ConfigName);
- client.RunCommand("echo rpconnect=" + rpcAllow + " >> " + DataDir + "/" + ConfigName);
- client.RunCommand("echo rpcport=" + rpcPort + " >> " + DataDir + "/" + ConfigName);
- client.RunCommand("echo rpcuser=" + rpcUser + " >> " + DataDir + "/" + ConfigName);
- client.RunCommand("echo rpcpassword=" + rpcPassword + " >> " + DataDir + "/" + ConfigName);
- client.RunCommand(DaemonName);
- client.RunCommand("rm -rf build");
- client.Disconnect();
- return Content("The Ubunutu Update for " + ServerName + " is compelte");
- }
- }
- catch (Exception ex)
- {
- return Content("A Failure occured" + ex);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement