Skip to content

Commit

Permalink
linux postinstall: replace no longer working --output param
Browse files Browse the repository at this point in the history
  • Loading branch information
sechmann committed Oct 18, 2024
1 parent 3baf220 commit 84d31bc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packaging/linux/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ ensure_line "nav/NAV_Sub_CA.crt" "/etc/ca-certificates.conf"
update-ca-certificates

# Assert just _one_ logged-in user
user_accounts=$(loginctl list-users --output json | jq '[.[] | select(.uid >= 1000)]')
if echo "$user_accounts" | jq -e 'length != 1' > /dev/null; then
user_accounts=$(loginctl list-users -j | jq '[.[] | select(.uid >= 1000)]')
if echo "$user_accounts" | jq -e 'length != 1' >/dev/null; then
printf "\nMore than 1 user account logged in! naisdevice only permits _one_ user account!\n"
exit 1
fi

# Assert only whitelisted service accounts "logged in" (if logged in at all)
service_accounts=$(loginctl list-users --output json | jq -e '[.[] | select(.uid < 1000)]')
if echo "$service_accounts" | jq -e 'length > 0' > /dev/null; then
service_accounts=$(loginctl list-users -j | jq -e '[.[] | select(.uid < 1000)]')
if echo "$service_accounts" | jq -e 'length > 0' >/dev/null; then
is_not_whitelisted=0

whitelisted_service_accounts="gdm,"
Expand Down

0 comments on commit 84d31bc

Please sign in to comment.