-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(packaging): add maintainer scripts to enable the service on inst…
…allation (#4) * feat(packaging): add maintainer scripts to auto start the service on installation * start service on post installation and stop service on pre-removal
- Loading branch information
1 parent
058110e
commit c8cde94
Showing
6 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/sh | ||
|
||
# enable and start services (only if the binary is found) | ||
if command -V tedge-agent >/dev/null 2>&1; then | ||
tedgectl enable tedge-agent | ||
tedgectl start tedge-agent | ||
fi | ||
|
||
if command -V tedge-mapper-c8y >/dev/null 2>&1; then | ||
tedgectl enable tedge-mapper-c8y | ||
tedgectl start tedge-mapper-c8y | ||
fi | ||
|
||
if command -V c8y-configuration-plugin >/dev/null 2>&1; then | ||
tedgectl enable c8y-configuration-plugin | ||
tedgectl start c8y-configuration-plugin | ||
fi | ||
|
||
if command -V c8y-log-plugin >/dev/null 2>&1; then | ||
tedgectl enable c8y-log-plugin | ||
tedgectl start c8y-log-plugin | ||
fi | ||
|
||
if command -V c8y-firmware-plugin >/dev/null 2>&1; then | ||
tedgectl enable c8y-firmware-plugin | ||
tedgectl start c8y-firmware-plugin | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
|
||
# disable services (ignore if not found) | ||
tedgectl disable tedge-agent 2>/dev/null ||: | ||
tedgectl disable tedge-mapper-c8y 2>/dev/null ||: | ||
tedgectl disable c8y-configuration-plugin 2>/dev/null ||: | ||
tedgectl disable c8y-log-plugin 2>/dev/null ||: | ||
tedgectl disable c8y-firmware-plugin 2>/dev/null ||: | ||
|
||
# stop services (ignore if not found) | ||
tedgectl stop tedge-agent 2>/dev/null ||: | ||
tedgectl stop tedge-mapper-c8y 2>/dev/null ||: | ||
tedgectl stop c8y-configuration-plugin 2>/dev/null ||: | ||
tedgectl stop c8y-log-plugin 2>/dev/null ||: | ||
tedgectl stop c8y-firmware-plugin 2>/dev/null ||: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters