mirror of
https://github.com/rwinkhart/libmutton.git
synced 2026-08-28 21:06:42 -04:00
Implement device ID server registration and server-side init
This commit is contained in:
+2
-4
@@ -90,13 +90,11 @@ func Shear(targetLocationIncomplete string, deviceID string) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
backend.ReadConfig([]string{"sshUser"}, "0") // exits if value does not exist (indicates offline mode)
|
||||
// if running on the client in online mode...
|
||||
} else { // if running on the client... (online mode determined dynamically in GetSSHOutput, will simply exit if not in online mode)
|
||||
// determine client device ID (to send to server, avoids creating a deletion file for the client device)
|
||||
deviceID = deviceIDList[0].Name()
|
||||
// below: deviceID and targetLocationIncomplete are separated by \x1d, path separators are replaced with \x1e, and spaces are replaced with \x1f
|
||||
getSSHOutput("libmuttonserver shear "+deviceID+"\x1d"+strings.ReplaceAll(strings.ReplaceAll(targetLocationIncomplete, backend.PathSeparator, "\x1e"), " ", "\x1f"), true)
|
||||
GetSSHOutput("libmuttonserver shear "+deviceID+"\x1d"+strings.ReplaceAll(strings.ReplaceAll(targetLocationIncomplete, backend.PathSeparator, "\x1e"), " ", "\x1f"), false)
|
||||
}
|
||||
|
||||
os.Exit(0)
|
||||
|
||||
Reference in New Issue
Block a user