Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eepm
Commits
15c42511
Commit
15c42511
authored
Jul 18, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm-sh-functions: add check_su_root
parent
34ee4b9c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
epm-sh-functions
bin/epm-sh-functions
+15
-0
No files found.
bin/epm-sh-functions
View file @
15c42511
...
...
@@ -359,6 +359,19 @@ info()
fi
}
check_su_root
()
{
[
"
$BASEDISTRNAME
"
=
"alt"
]
||
return
0
is_root
||
return
0
echo
"
$PATH
"
|
grep
-q
"/usr/sbin"
&&
return
0
fatal
"There is missed /usr/sbin path in PATH. Probably you have used 'su' without '-' to get root access. Use 'esu' or 'su -' command to get root permissions."
}
# if we have not sudo, returns 1 and set SUDO variable to fatal
SUDO_TESTED
=
''
SUDO_CMD
=
'sudo'
...
...
@@ -378,6 +391,8 @@ set_sudo()
return
fi
check_su_root
# if we are root, do not need sudo
is_root
&&
return
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment