diff --git a/zenoh-bridge-ros2dds/.deb/postinst b/zenoh-bridge-ros2dds/.deb/postinst index 51a2be4..7644a10 100644 --- a/zenoh-bridge-ros2dds/.deb/postinst +++ b/zenoh-bridge-ros2dds/.deb/postinst @@ -20,7 +20,12 @@ set -e case "$1" in configure) - id -u zenoh-bridge-ros2dds >/dev/null 2>&1 || sudo useradd -r -s /bin/false zenoh-bridge-ros2dds + if ! command -v systemctl &> /dev/null + then + echo "WARNING: 'systemctl' not found - cannot install zenoh-bridge-ros2dds as a service." + exit 0 + fi + id -u zenoh-bridge-ros2dds &> /dev/null || useradd -r -s /bin/false zenoh-bridge-ros2dds systemctl daemon-reload systemctl disable zenoh-bridge-ros2dds ;; diff --git a/zenoh-bridge-ros2dds/.deb/postrm b/zenoh-bridge-ros2dds/.deb/postrm index fcb339b..3ff16df 100644 --- a/zenoh-bridge-ros2dds/.deb/postrm +++ b/zenoh-bridge-ros2dds/.deb/postrm @@ -20,7 +20,7 @@ set -e case "$1" in purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) - userdel zenoh-bridge-ros2dds + userdel zenoh-bridge-ros2dds > /dev/null 2>&1 || true rm -rf /etc/zenoh-bridge-ros2dds ;;