We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2cf3ce4 commit 71c8d9eCopy full SHA for 71c8d9e
packaging/linux/postinstall
@@ -18,8 +18,14 @@ ensure_line "nav/NAV_Sub_CA.crt" "/etc/ca-certificates.conf"
18
19
update-ca-certificates
20
21
-# Assert just _one_ logged-in user
22
-user_accounts=$(loginctl list-users -j | jq '[.[] | select(.uid >= 1000)]')
+systemd_version="$(systemctl --version | head -n 1 | grep -o '[0-9]+' | head -n 1)"
+if [[ $systemd_version -gt 255 ]]; then
23
+ user_accounts=$(loginctl list-users -j | jq '[.[] | select(.uid >= 1000)]')
24
+else
25
+ user_accounts=$(loginctl list-users --output json | jq '[.[] | select(.uid >= 1000)]')
26
+fi
27
+echo $user_accounts
28
+
29
if echo "$user_accounts" | jq -e 'length != 1' >/dev/null; then
30
printf "\nMore than 1 user account logged in! naisdevice only permits _one_ user account!\n"
31
exit 1
0 commit comments