sconnect/lib/privileges

18 lines
277 B
Text
Raw Normal View History

2024-06-02 22:13:33 +02:00
#!/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) $@
}