Commit 7a5728e 1 parent 985451a commit 7a5728e Copy full SHA for 7a5728e
File tree 1 file changed +8
-7
lines changed
src/main/kotlin/com/vk/admstorm/ssh
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,12 @@ class YubikeyHandler {
22
22
private val LOG = logger<YubikeyHandler >()
23
23
}
24
24
25
+ private val openscPath = if (SystemInfo .isLinux) {
26
+ " usr/lib/x86_64-linux-gnu/opensc-pkcs11.so"
27
+ } else {
28
+ " /usr/local/lib/opensc-pkcs11.so"
29
+ }
30
+
25
31
fun autoReset (project : Project , onFail : Runnable ): Boolean {
26
32
LOG .info(" Try auto reset Yubikey" )
27
33
val resetScript = createScriptIfNotExists(project) ? : return false
@@ -44,11 +50,7 @@ class YubikeyHandler {
44
50
PasswordSafe .instance.getPassword(credentialAttributes)!!
45
51
}
46
52
47
- val openscPath = if (SystemInfo .isLinux) {
48
- " usr/lib/x86_64-linux-gnu/opensc-pkcs11.so"
49
- } else {
50
- " /usr/local/lib/opensc-pkcs11.so"
51
- }
53
+
52
54
53
55
val evalOutput = CommandRunner .runLocallyEval(" ssh-agent -s" )
54
56
if (evalOutput == null ) {
@@ -64,8 +66,7 @@ class YubikeyHandler {
64
66
65
67
val echoBuilder = ProcessBuilder (" echo" , password)
66
68
67
- val sshResetKey = CommandRunner .runLocally(project," ssh-add -e $openscPath " )
68
-
69
+ val sshResetKey = CommandRunner .runLocally(project, " ssh-add -e $openscPath " )
69
70
val resetOk = sshResetKey.stderr.contains(" Card removed" )
70
71
71
72
if (! resetOk) {
You can’t perform that action at this time.
0 commit comments