Skip to content

Commit 3c01e91

Browse files
author
Andreas Poulsen
committed
fix network manager script for ubuntu 22
1 parent ed4fb17 commit 3c01e91

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

os2borgerpc/os2borgerpc/network_manager_allow_user_changes.sh

+5
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@ ACTIVATE="$1"
1313
# Note to future dev: Method attempted which proved unsuccessful:
1414
# 1. Add user to netdev, systemd-network or network groups
1515
FILE=/etc/NetworkManager/NetworkManager.conf
16+
FILE2=/var/lib/polkit-1/localauthority/50-local.d/networkmanager.pkla
1617

1718
# Cleanup after previous runs of this script - or disable access if previously given (idempotency)
1819
sed --in-place '/auth-polkit=false/d' $FILE
20+
# Only make this replacement for user-related entries
21+
sed --in-place '/unix-group:user/{ n; n; n; n; s/ResultActive=yes/ResultActive=no/ }' $FILE2
1922

2023
if [ "$ACTIVATE" = 'True' ]; then
2124
sed --in-place '/\[main\]/a\auth-polkit=false' $FILE
25+
# Only make this replacement for user-related entries
26+
sed --in-place '/unix-group:user/{ n; n; n; n; s/ResultActive=no/ResultActive=yes/ }' $FILE2
2227
fi

0 commit comments

Comments
 (0)