mirror of
https://github.com/bol-van/zapret.git
synced 2024-12-24 23:26:42 +00:00
14 lines
256 B
Bash
14 lines
256 B
Bash
|
require_root()
|
||
|
{
|
||
|
local exe
|
||
|
echo \* checking privileges
|
||
|
[ $(id -u) -ne "0" ] && {
|
||
|
echo root is required
|
||
|
exe="$EXEDIR/$(basename "$0")"
|
||
|
exists sudo && exec sudo "$exe"
|
||
|
exists su && exec su root -c "$exe"
|
||
|
echo su or sudo not found
|
||
|
exitp 2
|
||
|
}
|
||
|
}
|