From 8af0eed9c8f83b23f8a1fd74acb278f74ff033ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20M=C3=BCnch?= Date: Sat, 23 Dec 2023 14:22:56 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=89=20add=20updater=20service=20to=20l?= =?UTF-8?q?inux=20install=20script=20(#402)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick Münch --- install.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 7d7638d9..bb732719 100755 --- a/install.sh +++ b/install.sh @@ -626,12 +626,12 @@ EOL elif [ "$OS" = "Arch" ]; then purple_bold "\n* Enable and start the mondoo service" sudo_cmd systemctl enable mondoo.service - sudo_cmd systemctl start mondoo.service + sudo_cmd systemctl restart mondoo.service sudo_cmd systemctl daemon-reload else purple_bold "\n* Enable and start the cnspec service" sudo_cmd systemctl enable cnspec.service - sudo_cmd systemctl start cnspec.service + sudo_cmd systemctl restart cnspec.service sudo_cmd systemctl daemon-reload fi } @@ -681,8 +681,13 @@ EOL sleep 5 sudo_cmd launchctl load /Library/LaunchDaemons/com.mondoo.autoupdater.plist sudo_cmd launchctl start /Library/LaunchDaemons/com.mondoo.autoupdater.plist - else - echo $'#!/bin/sh\nbash -c "$(curl -sSL https://install.mondoo.com/sh)"' > /etc/cron.weekly/mondoo-update + elif [ "$OS" = "RedHat" ] || [ "$OS" = "Debian" ] || [ "$OS" = "Suse" ]; then + sudo_cmd tee /etc/cron.weekly/mondoo-update < /var/log/mondoo-updater.log +curl -sSL https://install.mondoo.com/sh | bash -s -- -s enable >> /var/log/mondoo-updater.log +EOL + sudo_cmd chmod a+x /etc/cron.weekly/mondoo-update fi }