From 859c71a0afcf0c5fd66188f769c7996351b468e1 Mon Sep 17 00:00:00 2001 From: par Date: Fri, 24 Jan 2025 10:14:18 +0100 Subject: [PATCH] fixed editing crontab --- debian/neobotix-tools/DEBIAN/postinst | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/debian/neobotix-tools/DEBIAN/postinst b/debian/neobotix-tools/DEBIAN/postinst index 524ea6c..7045050 100755 --- a/debian/neobotix-tools/DEBIAN/postinst +++ b/debian/neobotix-tools/DEBIAN/postinst @@ -28,11 +28,8 @@ visudo -c -f /etc/sudoers.d/neobotix sed -i 's/APT::Periodic::Update-Package-Lists "1"/APT::Periodic::Update-Package-Lists "0"/' /etc/apt/apt.conf.d/20auto-upgrades # Setup cron job for configuring can interface -#(crontab -l 2>/dev/null; echo "@reboot /opt/neobotix/tools/enable_can0.sh") | crontab - -#grep '/opt/neobotix/tools/enable_can0.sh' /etc/crontab || echo '@reboot /opt/neobotix/tools/enable_can0.sh' >> /etc/crontab - -if ! crontab -l | grep -q '/opt/neobotix/tools/enable_can0.sh'; then (crontab -l 2>/dev/null; echo "@reboot /opt/neobotix/tools/enable_can0.sh") | crontab -; fi -if ! crontab -l | grep -q '/opt/neobotix/tools/enable_multicast_lo.sh'; then (crontab -l 2>/dev/null; echo "@reboot /opt/neobotix/tools/enable_multicast_lo.sh") | crontab -; fi +if ! crontab -l | grep -q '/opt/neobotix/tools/enable_can0.sh'; then crontab -l 2>/dev/null | { cat; echo "@reboot /opt/neobotix/tools/enable_can0.sh"; } | crontab -; fi +if ! crontab -l | grep -q '/opt/neobotix/tools/enable_multicast_lo.sh'; then (crontab -l 2>/dev/null | { cat; echo "@reboot /opt/neobotix/tools/enable_multicast_lo.sh"; } | crontab -; fi # Setup udev rules for serial converter echo 'SUBSYSTEM=="tty", SUBSYSTEMS=="usb", ENV{ID_VENDOR}=="FTDI", ENV{ID_MODEL_ID}=="6010", ENV{ID_USB_INTERFACE_NUM}=="00", SYMLINK+="neo-relayboard"' > /etc/udev/rules.d/99-usb-serial.rules