Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions zenoh-bridge-ros2dds/.deb/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ set -e

case "$1" in
configure)
if ! command -v systemctl &> /dev/null
then
echo "WARNING: 'systemctl' not found - cannot install zenoh-bridge-ros2dds as a service."
exit 0
fi
SYSTEMCTL_CMD=$(command -v systemctl)
if [ -z "$SYSTEMCTL_CMD" ]; then
echo "WARNING: 'systemctl' not found - cannot install zenoh-bridge-ros2dds as a service."
exit 0
fi
echo "Found $SYSTEMCTL_CMD"
id -u zenoh-bridge-ros2dds &> /dev/null || useradd -r -s /bin/false zenoh-bridge-ros2dds
systemctl daemon-reload
systemctl disable zenoh-bridge-ros2dds
"$SYSTEMCTL_CMD" daemon-reload
"$SYSTEMCTL_CMD" disable zenoh-bridge-ros2dds
;;

abort-upgrade|abort-remove|abort-deconfigure)
Expand Down
Loading