mirror of
https://github.com/bol-van/zapret.git
synced 2025-04-19 13:32:58 +03:00
install_easy : fix exit when su/sudo notfound
This commit is contained in:
parent
a20e7f2353
commit
f5eaf13cbb
@ -24,14 +24,6 @@ whichq()
|
|||||||
which $1 2>/dev/null
|
which $1 2>/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
[ $(id -u) -ne "0" ] && {
|
|
||||||
echo root is required
|
|
||||||
exists sudo && exec sudo $0
|
|
||||||
exists su && exec su -c $0
|
|
||||||
echo su or sudo not found
|
|
||||||
exit 2
|
|
||||||
}
|
|
||||||
|
|
||||||
exitp()
|
exitp()
|
||||||
{
|
{
|
||||||
echo
|
echo
|
||||||
@ -40,6 +32,14 @@ exitp()
|
|||||||
exit $1
|
exit $1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ $(id -u) -ne "0" ] && {
|
||||||
|
echo root is required
|
||||||
|
exists sudo && exec sudo $0
|
||||||
|
exists su && exec su -c $0
|
||||||
|
echo su or sudo not found
|
||||||
|
exitp 2
|
||||||
|
}
|
||||||
|
|
||||||
get_dir_inode()
|
get_dir_inode()
|
||||||
{
|
{
|
||||||
ls -id "$1" | cut -f1 -d ' '
|
ls -id "$1" | cut -f1 -d ' '
|
||||||
|
Loading…
x
Reference in New Issue
Block a user