-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a9dc18b
commit 3e5d0be
Showing
5 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
system_files/shared/usr/lib/systemd/system/aurora-groups.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[Unit] | ||
Description=Add plugdev groups | ||
[Service] | ||
Type=oneshot | ||
ExecStart=/usr/libexec/aurora-groups | ||
Restart=on-failure | ||
RestartSec=30 | ||
StartLimitInterval=0 | ||
[Install] | ||
WantedBy=default.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env bash | ||
# SCRIPT VERSION | ||
GROUP_SETUP_VER=1 | ||
GROUP_SETUP_VER_FILE="/etc/ublue/aurora-groups" | ||
GROUP_SETUP_VER_RAN=$(cat "$GROUP_SETUP_VER_FILE") | ||
# Run script if updated | ||
if [[ -f $GROUP_SETUP_VER_FILE && "$GROUP_SETUP_VER" = "$GROUP_SETUP_VER_RAN" ]]; then | ||
echo "Group setup has already run. Exiting..." | ||
exit 0 | ||
fi | ||
# Function to append a group entry to /etc/group | ||
append_group() { | ||
local group_name="$1" | ||
if ! grep -q "^$group_name:" /etc/group; then | ||
echo "Appending $group_name to /etc/group" | ||
grep "^$group_name:" /usr/lib/group | tee -a /etc/group > /dev/null | ||
fi | ||
} | ||
# Setup Groups | ||
append_group plugdev | ||
wheelarray=($(getent group wheel | cut -d ":" -f 4 | tr ',' '\n')) | ||
for user in $wheelarray | ||
do | ||
usermod -aG plugdev $user | ||
done | ||
# Prevent future executions | ||
echo "Writing state file" | ||
echo "$GROUP_SETUP_VER" > "$GROUP_SETUP_VER_FILE" |