This commit is contained in:
Strix 2024-06-02 22:13:33 +02:00
commit 1816522a71
11 changed files with 229 additions and 0 deletions

18
lib/privileges Normal file
View file

@ -0,0 +1,18 @@
#!/bin/sh
escalate_command() {
if [ "$(id -u)" = "0" ]; then
$@
else
sudo -E $@
fi
}
escalate() {
export SC_ESCALATED=1
export SC_SKIP_WELCOME_HEADER=1
echo "e: sc-client $@"
escalate_command $(get_first_in_list $SC_COMMAND) $@
}