mirror of
https://github.com/bol-van/zapret.git
synced 2024-12-23 06:42:34 +00:00
install_easy: do not use privileged /proc/1/exe
This commit is contained in:
parent
980c05fbe1
commit
473a2c59e2
@ -206,7 +206,8 @@ check_system()
|
||||
|
||||
local UNAME=$(uname)
|
||||
if [ "$UNAME" = "Linux" ]; then
|
||||
local INIT="$(basename $(readlink /proc/1/exe))"
|
||||
# do not use 'exe' because it requires root
|
||||
local INIT="$(basename $(sed 's/\x0/\n/g' /proc/1/cmdline | head -n 1))"
|
||||
# some distros include systemctl without systemd
|
||||
if [ -d "$SYSTEMD_DIR" ] && [ -x "$SYSTEMCTL" ] && [ "$INIT" = "systemd" ]; then
|
||||
SYSTEM=systemd
|
||||
|
@ -53,7 +53,8 @@ check_system()
|
||||
|
||||
local UNAME=$(uname)
|
||||
if [ "$UNAME" = "Linux" ]; then
|
||||
local INIT="$(basename $(readlink /proc/1/exe))"
|
||||
# do not use 'exe' because it requires root
|
||||
local INIT="$(basename $(sed 's/\x0/\n/g' /proc/1/cmdline | head -n 1))"
|
||||
# some distros include systemctl without systemd
|
||||
if [ -d "$SYSTEMD_DIR" ] && [ -x "$SYSTEMCTL" ] && [ "$INIT" = "systemd" ]; then
|
||||
SYSTEM=systemd
|
||||
|
Loading…
Reference in New Issue
Block a user