mirror of
https://github.com/the-sane/lug-helper.git
synced 2024-12-29 05:04:22 +00:00
Fallback to sudo where pollkit is unavailable
This commit is contained in:
parent
478ff37b8a
commit
7b7460fa0d
@ -1080,7 +1080,12 @@ preflight_check() {
|
|||||||
|
|
||||||
# Execute the actions set by the functions
|
# Execute the actions set by the functions
|
||||||
if [ ! -z "$preflight_actions_string" ]; then
|
if [ ! -z "$preflight_actions_string" ]; then
|
||||||
pkexec sh -c "$preflight_actions_string"
|
# Use pollkit's pkexec for gui with a fallback to sudo
|
||||||
|
if [ -x "$(command -v pkexec)" ]; then
|
||||||
|
pkexec sh -c "$preflight_actions_string"
|
||||||
|
else
|
||||||
|
sudo sh -c "$preflight_actions_string"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Call any followup functions
|
# Call any followup functions
|
||||||
|
Loading…
Reference in New Issue
Block a user