#!/bin/sh # SPDX-License-Identifier: GPL-3.0-or-later # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Copyright (C) 2015 - 2024 nymea GmbH # # Copyright (C) 2024 - 2025 chargebyte austria GmbH # # # # This file is part of nymea. # # # # nymea is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation, either version 3 of the License, or # # (at your option) any later version. # # # # nymea is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with nymea. If not, see . # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Make sure user will be able to perform a networkdiscovery # using ARP and ICMP sockets (raw_sock). setcap cap_net_admin,cap_net_raw=eip /usr/bin/nymead if [ $? -eq 0 ]; then echo "Set raw socket network capabilities successfully for nymead." else echo "Failed to set raw socket network capabilities for nymead. Network device discovery will not be available for non root users." fi # nymea hook to restart nymead after upgrades that change nymea plugins or libraries cat < /etc/apt/apt.conf.d/99nymea DPkg::Pre-Install-Pkgs {"/usr/libexec/nymea-upgrade-helper"; }; DPkg::Tools::Options::/usr/libexec/nymea-upgrade-helper::Version "1"; DPkg::Post-Invoke {"if [ -e /tmp/nymea-restart-pending ]; then systemctl restart nymead; rm /tmp/nymea-restart-pending; fi"; }; EOF #DEBHELPER# exit 0