keys: read SSH_AUTH_SOCK
This commit is contained in:
parent
cf92e27ada
commit
1cb01cd7f1
|
@ -18,6 +18,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
using SparkleLib;
|
using SparkleLib;
|
||||||
|
|
||||||
|
@ -88,8 +89,12 @@ namespace SparkleShare {
|
||||||
SparkleLogger.LogInfo ("Auth", "No key agent running, starting one...");
|
SparkleLogger.LogInfo ("Auth", "No key agent running, starting one...");
|
||||||
|
|
||||||
SparkleProcess process = new SparkleProcess ("ssh-agent", "");
|
SparkleProcess process = new SparkleProcess ("ssh-agent", "");
|
||||||
process.Start ();
|
string output = process.StartAndReadStandardOutput ();
|
||||||
process.WaitForExit ();
|
|
||||||
|
Match auth_sock_match = new Regex (@"SSH_AUTH_SOCK=([^;\n\r]*)").Match (output);
|
||||||
|
|
||||||
|
if (auth_sock_match.Success)
|
||||||
|
Environment.SetEnvironmentVariable ("SSH_AUTH_SOCK", auth_sock_match.Groups [1].Value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue