refactor: improve detection of chroot jail

Signed-off-by: Stephan Wendel <me@stephanwe.de>
This commit is contained in:
Stephan Wendel 2022-05-04 19:23:37 +02:00
parent c4d4795089
commit 36893bf9d4
No known key found for this signature in database
GPG Key ID: F465B83ACBA45639

View File

@ -201,7 +201,7 @@ function install_crowsnest {
sudo sed -i 's|pi|'"${BASE_USER}"'|g' /etc/logrotate.d/webcamd
fi
echo -e "Linking logrotate file ... [OK]\r"
if [ "${UNATTENDED}" == "false" ]; then
if [ "${UNATTENDED}" == "false" ] && [ "$(stat -c %i /)" == "2" ]; then
echo -en "Reload systemd to enable new deamon ...\r"
sudo systemctl daemon-reload
echo -e "Reload systemd to enable new daemon ... [OK]"