2009-08-26 17:00:38 +02:00
|
|
|
#!/bin/sh
|
2018-06-13 07:43:00 +02:00
|
|
|
|
2009-08-26 17:00:38 +02:00
|
|
|
config() {
|
2018-06-13 07:43:00 +02:00
|
|
|
for infile in $1; do
|
|
|
|
NEW="$infile"
|
|
|
|
OLD="$(dirname $NEW)/$(basename $NEW .new)"
|
|
|
|
# If there's no config file by that name, mv it over:
|
|
|
|
if [ ! -r $OLD ]; then
|
|
|
|
mv $NEW $OLD
|
|
|
|
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
|
|
|
|
# toss the redundant copy
|
|
|
|
rm $NEW
|
|
|
|
fi
|
|
|
|
# Otherwise, we leave the .new copy for the admin to consider...
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
preserve_perms() {
|
2009-08-26 17:00:38 +02:00
|
|
|
NEW="$1"
|
2018-06-13 07:43:00 +02:00
|
|
|
OLD="$(dirname $NEW)/$(basename $NEW .new)"
|
|
|
|
if [ -e $OLD ]; then
|
|
|
|
cp -a $OLD ${NEW}.incoming
|
|
|
|
cat $NEW > ${NEW}.incoming
|
|
|
|
mv ${NEW}.incoming $NEW
|
2009-08-26 17:00:38 +02:00
|
|
|
fi
|
2018-06-13 07:43:00 +02:00
|
|
|
config $NEW
|
2009-08-26 17:00:38 +02:00
|
|
|
}
|
2018-06-13 07:43:00 +02:00
|
|
|
|
|
|
|
preserve_perms etc/rc.d/rc.atd.new
|
|
|
|
config etc/default/atd.new
|
2009-08-26 17:00:38 +02:00
|
|
|
config etc/at.deny.new
|
2018-06-13 07:43:00 +02:00
|
|
|
|
2009-08-26 17:00:38 +02:00
|
|
|
if [ ! -r var/spool/atjobs/.SEQ ]; then
|
|
|
|
touch var/spool/atjobs/.SEQ
|
|
|
|
chmod 660 var/spool/atjobs/.SEQ
|
|
|
|
chown daemon.daemon var/spool/atjobs/.SEQ
|
|
|
|
fi
|