Skip to content

Commit

Permalink
only enable services if it exists
Browse files Browse the repository at this point in the history
Signed-off-by: Reuben Miller <reuben.d.miller@gmail.com>
  • Loading branch information
reubenmiller committed Oct 3, 2024
1 parent 23a21aa commit a3a49b2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions images/common/optional-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,13 @@ configure_users() {

configure_services() {
if command_exists systemctl; then
sudo systemctl enable ssh
sudo systemctl enable tedge-mapper-collectd
if sudo systemctl list-unit-files ssh.service >/dev/null >&2; then
sudo systemctl enable ssh.service
fi

if sudo systemctl list-unit-files tedge-mapper-collectd.service >/dev/null >&2; then
sudo systemctl enable tedge-mapper-collectd.service
fi
fi
}

Expand Down

0 comments on commit a3a49b2

Please sign in to comment.