#!/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) $@
}