Skip to content

Instantly share code, notes, and snippets.

@EifelMono
Created February 8, 2018 16:49
Show Gist options
  • Save EifelMono/255f8b2487094f8d09b2c90b296f304a to your computer and use it in GitHub Desktop.
Save EifelMono/255f8b2487094f8d09b2c90b296f304a to your computer and use it in GitHub Desktop.
var ip= "192.168.179.1";
var name = "abcdefgd";
var commandTitle = $"echo -n -e \"\\033]0;[{name}]\\007\"";
var commandPing = $"ping {ip}";
File.WriteAllText("ping.command", $"{commandTitle}\n{commandPing}\n");
var commandLine= $"chmod +x ping.command; open ping.command";
new Process()
{
StartInfo = new ProcessStartInfo
{
UseShellExecute = true,
FileName = "/bin/bash",
Arguments = $"-c \"{commandLine}\"",
}
}.Start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment