The configuration file handling in here needs to be fixed. At the moment, the init script does
sed "s/FREQ_IN_MIN/$FREQ_IN_MIN/" "/usr/share/update-motd/update-motd.cron" > /etc/cron.d/update-motd
unconditionally. This overwrites the admin's changes without checking or confirmation.
If you ask me, I would ship /etc/cron.d/update-motd as a conffile, so that the admin can change it directly, without any dynamic magic. If you don't want to do that for some reason, you should do an ucf-like approach, create the config file in the postinst if it doesn't exist yet, or use ucf to manage it on package install/upgrades if it exists and was modified. I don't really see the need to do it in the init script. No other package does it that way, and it is higly unusal and also pretty brittle.
The configuration file handling in here needs to be fixed. At the moment, the init script does
sed "s/FREQ_ IN_MIN/ $FREQ_IN_ MIN/" "/usr/share/ update- motd/update- motd.cron" > /etc/cron. d/update- motd
unconditionally. This overwrites the admin's changes without checking or confirmation.
If you ask me, I would ship /etc/cron. d/update- motd as a conffile, so that the admin can change it directly, without any dynamic magic. If you don't want to do that for some reason, you should do an ucf-like approach, create the config file in the postinst if it doesn't exist yet, or use ucf to manage it on package install/upgrades if it exists and was modified. I don't really see the need to do it in the init script. No other package does it that way, and it is higly unusal and also pretty brittle.