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
11178060
Commit
11178060
authored
May 07, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
esu: add support for quoted args (with spaces)
parent
4252744e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
+22
-3
esu
bin/esu
+22
-3
No files found.
bin/esu
View file @
11178060
...
...
@@ -74,11 +74,30 @@ fi
set_pm_type
escape_args
()
{
local
output
=
''
while
[
-n
"
$1
"
]
;
do
if
has_space
"
$1
"
;
then
[
-n
"
$output
"
]
&&
output
=
"
$output
'
$1
'"
||
output
=
"'
$1
'"
else
[
-n
"
$output
"
]
&&
output
=
"
$output
$1
"
||
output
=
"
$1
"
fi
shift
done
echo
"
$output
"
}
escaped
=
"
$(
escape_args
"
$@
"
)
"
# sudo is not accessible, will ask root password
if
!
set_sudo
;
then
#info "Enter root password:"
if
[
-n
"
$*
"
]
;
then
exec
su -
-c
"
$@
"
[
-n
"
$quiet
"
]
||
showcmd
"su - -c
$escaped
"
exec
su -
-c
"
$escaped
"
else
# just shell
showcmd
"su -"
...
...
@@ -88,8 +107,8 @@ fi
#info "You can be asked about your password:"
if
[
-n
"
$*
"
]
;
then
[
-n
"
$quiet
"
]
||
showcmd
"
$SUDO
su - -c
$
*
"
$SUDO
su -
-c
"
$
@
"
[
-n
"
$quiet
"
]
||
showcmd
"
$SUDO
su - -c
$
escaped
"
$SUDO
su -
-c
"
$
escaped
"
else
showcmd
"
$SUDO
su -"
$SUDO
su -
...
...
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