mirror of
https://github.com/bol-van/zapret.git
synced 2024-11-26 20:20:53 +03:00
more compatible require_root
This commit is contained in:
parent
a8062252f4
commit
2f5c6b7e82
@ -87,11 +87,13 @@ ask_yes_no_var()
|
||||
|
||||
require_root()
|
||||
{
|
||||
local exe
|
||||
echo \* checking privileges
|
||||
[ $(id -u) -ne "0" ] && {
|
||||
echo root is required
|
||||
exists sudo && exec sudo "$0"
|
||||
exists su && exec su -c "$0"
|
||||
exe="$EXEDIR/$(basename "$0")"
|
||||
exists sudo && exec sudo "$exe"
|
||||
exists su && exec su root -c "$exe"
|
||||
echo su or sudo not found
|
||||
exitp 2
|
||||
}
|
||||
|
@ -55,11 +55,13 @@ exitp()
|
||||
|
||||
require_root()
|
||||
{
|
||||
local exe
|
||||
echo \* checking privileges
|
||||
[ $(id -u) -ne "0" ] && {
|
||||
echo root is required
|
||||
exists sudo && exec sudo "$0"
|
||||
exists su && exec su -c "$0"
|
||||
exe="$EXEDIR/$(basename "$0")"
|
||||
exists sudo && exec sudo "$exe"
|
||||
exists su && exec su root -c "$exe"
|
||||
echo su or sudo not found
|
||||
exitp 2
|
||||
}
|
||||
|
@ -33,11 +33,13 @@ exitp()
|
||||
|
||||
require_root()
|
||||
{
|
||||
local exe
|
||||
echo \* checking privileges
|
||||
[ $(id -u) -ne "0" ] && {
|
||||
echo root is required
|
||||
exists sudo && exec sudo "$0"
|
||||
exists su && exec su -c "$0"
|
||||
exe="$EXEDIR/$(basename "$0")"
|
||||
exists sudo && exec sudo "$exe"
|
||||
exists su && exec su root -c "$exe"
|
||||
echo su or sudo not found
|
||||
exitp 2
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user