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
Vladislav
eepm
Commits
bb60d622
Commit
bb60d622
authored
Dec 08, 2012
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add serv list command
parent
79e0adc4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
2 deletions
+43
-2
serv
bin/serv
+5
-2
serv-list
bin/serv-list
+38
-0
No files found.
bin/serv
View file @
bb60d622
...
...
@@ -107,7 +107,7 @@ print_version()
echo
"This program may be freely redistributed under the terms of the GNU GPL."
}
Usage
=
"Usage: serv [options]
<service>
[<command>] [params]..."
Usage
=
"Usage: serv [options]
[<service>]
[<command>] [params]..."
Descr
=
"serv - Service manager"
set_service_type
...
...
@@ -135,6 +135,9 @@ check_command()
stop
)
# HELPCMD: stop service
serv_cmd
=
stop
;;
list
)
# HELPCMD: list running services
serv_cmd
=
list
;;
on|enable
)
# HELPCMD: add service to run on startup and start it now
serv_cmd
=
enable
;;
...
...
@@ -189,7 +192,7 @@ echover "service: $service_name"
echover
"command:
$serv_cmd
"
# Just printout help if run without args
if
[
-z
"
$service_name
"
]
;
then
if
[
"
$serv_cmd
"
!=
"list"
]
&&
[
-z
"
$service_name
"
]
;
then
print_version
echo
fatal
"Run
$
serv --help for get help"
...
...
bin/serv-list
0 → 100644
View file @
bb60d622
#!/bin/sh
#
# Copyright (C) 2012 Etersoft
# Copyright (C) 2012 Vitaly Lipatov <lav@etersoft.ru>
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
#
# List running services
serv_list
()
{
case
$SERVICETYPE
in
# service-chkconfig)
# sudocmd service $1 stop
# ;;
# service-update)
# sudocmd /etc/init.d/$1 stop
# ;;
systemd
)
sudocmd systemctl list-units
;;
*
)
fatal
"Do not known command for
$SERVICETYPE
"
;;
esac
}
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