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
Nurlan
eepm
Commits
04bc80ba
Commit
04bc80ba
authored
Dec 07, 2017
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
serv list: improve speed with run sudo once
parent
8aa92b13
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
serv-list
bin/serv-list
+4
-1
No files found.
bin/serv-list
View file @
04bc80ba
...
...
@@ -20,6 +20,7 @@
# List running services
serv_list
()
{
info
"Running services:"
case
$SERVICETYPE
in
# service-chkconfig)
# ;;
...
...
@@ -33,9 +34,11 @@ serv_list()
sudocmd systemctl list-units
$@
;;
*
)
# hack to improve list speed
[
"
$UID
"
=
0
]
||
{
sudocmd
$PROGDIR
/serv
--quiet
list
;
return
;
}
load_helper serv-list_all
load_helper serv-status
for
i
in
$(
serv_list_all
)
;
do
for
i
in
$(
quiet
=
1
serv_list_all
)
;
do
is_service_running
$i
>
/dev/null
&&
echo
$i
done
;;
...
...
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