PC set-up: one line per PC (/setup/<name>.ps1), the admin laptop always let in, and the admin check no longer breaks the script
- the inserted administrator check split the header comment, leaving '} for ... run ONCE' as code: WS and SC
join.ps1 failed to parse (Windows' parser: Missing opening '(' after keyword 'for'); now after the whole line
- site.admin_ips / admin_keys (laptop 10.6.7.38, fixed in UniFi) go into every PC script's firewall rule and key
files, and into the Mac join line, so running a set-up again never shuts the laptop out
- scripts verified by Windows' own PowerShell parser on the NA Lighting PC
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -60,6 +60,12 @@ $userKeys = Join-Path $userSsh 'authorized_keys'
|
||||
if (-not (Test-Path $userKeys) -or -not (Select-String -Path $userKeys -SimpleMatch $KeyMark -Quiet)) {
|
||||
Add-Content -Path $userKeys -Value $Key -Encoding ascii
|
||||
}
|
||||
# The admin laptop's key too (it is let through the firewall above as well).
|
||||
foreach ($k in @({{ADMIN_KEYS}})) {
|
||||
foreach ($f in @($adminKeys, $userKeys)) {
|
||||
if (-not (Select-String -Path $f -SimpleMatch $k -Quiet)) { Add-Content -Path $f -Value $k -Encoding ascii }
|
||||
}
|
||||
}
|
||||
|
||||
# 3. Start tasks for the apps found on this PC (they run on this user's desktop)
|
||||
function Find-First($candidates) {
|
||||
|
||||
Reference in New Issue
Block a user