Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Renci.SshNet;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using MasternodeInstaller;
- namespace MasternodeInstaller
- {
- class Program
- {
- static void Main(string[] args)
- {
- startapp:
- Console.WriteLine("################################################################################");
- Console.WriteLine("# MP Hosting UK - Hosting Management Tool Version 0.1.080 RC");
- Console.WriteLine("");
- Console.WriteLine("# This application will only work with MP Hosting servers");
- Console.WriteLine("");
- Console.WriteLine("# What would you like to do today??");
- Console.WriteLine("# 1 :-: Install Masternode");
- Console.WriteLine("# 2 :-: Install Coin (Basic Config)");
- Console.WriteLine("# 3 :-: Install Coin (Advanced Config)");
- Console.WriteLine("");
- var option = Console.ReadKey();
- if (option.Key == ConsoleKey.D1)
- {
- InstallMasterNodeMenu();
- }
- else if (option.Key == ConsoleKey.D2)
- {
- }
- else if (option.Key == ConsoleKey.D3)
- {
- }
- else
- {
- goto startapp;
- }
- }
- static void InstallMasterNodeMenu()
- {
- installermenu:
- Console.Clear();
- Console.WriteLine("What masternode would you like to install today");
- Console.WriteLine("");
- Console.WriteLine("# 1 :-: DASH");
- Console.WriteLine("# 2 :-: PivX");
- var option = Console.ReadKey();
- if (option.Key == ConsoleKey.D1)
- {
- DashInstaller();
- }
- else if (option.Key == ConsoleKey.D2)
- {
- PivxInstaller();
- }
- }
- //
- // mnInstallers
- //
- static void DashInstaller()
- {
- Console.Clear();
- Console.WriteLine("###############################################################################");
- Console.WriteLine("# ");
- Console.WriteLine("# In order to install DASH we need to collect a few details from you, the ");
- Console.WriteLine("# information can be found in your client portal for the target server");
- Console.WriteLine("");
- Console.WriteLine("## Please enter the server ip address");
- string serverIp = Console.ReadLine();
- Console.WriteLine("## Please enter the server username");
- string serverUser = Console.ReadLine();
- Console.WriteLine("## Please enter your server password");
- string serverPassword = Console.ReadLine();
- Console.WriteLine("## Please enter your masternode key");
- string masterNodeKey = Console.ReadLine();
- Console.WriteLine("");
- Console.WriteLine("# You are about to install DASH to server " + serverIp + " as user " + serverUser);
- Console.WriteLine("# Execute Y/N");
- var option = Console.ReadKey();
- if (option.Key == ConsoleKey.Y)
- {
- using (var ssh = new SshClient(serverIp, serverUser, serverPassword))
- {
- ssh.Connect();
- if (ssh.IsConnected)
- {
- Console.WriteLine("# Connected to server, downloading file");
- ssh.RunCommand("wget http://195.74.52.190:82/dash.zip");
- ssh.RunCommand("wget http://195.74.52.190:82/dash-chain.zip");
- Console.WriteLine("# Download Complete. Extracting Files");
- ssh.RunCommand("unzip dash.zip && unzip dash-chain.zip .dash");
- ssh.RunCommand("screen -dmS dash ~/dashd");
- Console.WriteLine("# Dash is now installed and running. Stopping");
- ssh.RunCommand("killall screen");
- ssh.RunCommand("echo " + masterNodeKey + " >> .dash/masternode.conf");
- ssh.RunCommand("./dashd");
- Console.WriteLine("Install Complete. Disconnecting WAIT....");
- ssh.Disconnect();
- Console.WriteLine("# All Done, this app will now teminate");
- }
- else
- {
- Console.WriteLine("Error");
- }
- }
- }
- else
- {
- }
- }
- static void PivxInstaller()
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement