Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
bpm-sw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
bpm
bpm-sw
Commits
075f0c13
Commit
075f0c13
authored
Feb 05, 2016
by
Lucas Russo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scripts/*: add enable/disable service scripts
parent
f26abb7d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
94 additions
and
0 deletions
+94
-0
disable-service.sh
scripts/disable-service.sh
+47
-0
enable-service.sh
scripts/enable-service.sh
+47
-0
No files found.
scripts/disable-service.sh
0 → 100755
View file @
075f0c13
#!/usr/bin/env bash
function
usage
()
{
echo
"Usage:
$0
[-s <service_name>]"
}
SERVICE
=
# Get command line options
while
getopts
":s:"
opt
;
do
case
$opt
in
d
)
SERVICE
=
$OPTARG
;;
\?
)
echo
"Invalid option: -
$OPTARG
"
>
&2
usage
exit
1
;;
:
)
echo
"Option -
$OPTARG
requires an argument."
>
&2
usage
exit
1
;;
esac
done
INIT_SYSTEM
=
$(
./get-init-system.sh
)
# Enable service depending on which init system we are
case
${
INIT_SYSTEM
}
in
"systemd"
)
echo
"Disabling systemd service "
${
SERVICE
}
systemctl disable
${
SERVICE
}
;;
"upstart"
)
echo
"Disabling upstart service "
${
SERVICE
}
;;
"sysv-init"
)
echo
"Disabling sysv-init service "
${
SERVICE
}
;;
"?"
)
echo
"Invalid init system detected."
>
&2
exit
1
;;
esac
scripts/enable-service.sh
0 → 100755
View file @
075f0c13
#!/usr/bin/env bash
function
usage
()
{
echo
"Usage:
$0
[-s <service_name>]"
}
SERVICE
=
# Get command line options
while
getopts
":s:"
opt
;
do
case
$opt
in
d
)
SERVICE
=
$OPTARG
;;
\?
)
echo
"Invalid option: -
$OPTARG
"
>
&2
usage
exit
1
;;
:
)
echo
"Option -
$OPTARG
requires an argument."
>
&2
usage
exit
1
;;
esac
done
INIT_SYSTEM
=
$(
./get-init-system.sh
)
# Enable service depending on which init system we are
case
${
INIT_SYSTEM
}
in
"systemd"
)
echo
"Enabling systemd service "
${
SERVICE
}
systemctl
enable
${
SERVICE
}
;;
"upstart"
)
echo
"Enabling upstart service "
${
SERVICE
}
;;
"sysv-init"
)
echo
"Enabling sysv-init service "
${
SERVICE
}
;;
"?"
)
echo
"Invalid init system detected."
>
&2
exit
1
;;
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