TMPDIR=$(mktemp -d);
-if [ "$HOSTNAME" == "rietz" ]; then
+if [ "$HOSTNAME" = "rietz" ]; then
BASEDIR="/org/bugs.debian.org"
USERCONF="bugs/user_prefs";
-elif [ "$HOSTNAME" == "murphy" ]; then
+elif [ "$HOSTNAME" = "liszt" ]; then
BASEDIR="/var/list/.etc";
- USERCONF="bugs/user_prefs";
+ USERCONF="lists/user_prefs";
else
echo "Unknown hostname '$HOSTNAME'";
exit 1;
NEWREV=$(svn info $(svn info $SACONFIG|awk '/^URL:/{print $2}')|awk '/^Revision:/{print $2}')
# no changes, bug out.
-if [ $ORIGREV -ge $NEWREV ]; then
+if [ "0$ORIGREV" -ge "0$NEWREV" ]; then
exit 0;
fi;
-if [ -e "$SACONFIG/.update_spamassassin" ] && kill -0 $(cat "$SACONFIG/.update_spamassassin"); then
+if [ -e "$SACONFIG/.update_spamassassin" ] && kill -0 $(cat "$SACONFIG/.update_spamassassin") >/dev/null 2>&1; then
echo "Another update_spamassassin appears to be running"
exit 1;
else
# Hrm; a previous update failed; don't report again until the file
# is removed
if [ -e "$SACONFIG/failed_update" ]; then
+ rm -rf "$TMPDIR"
exit 0;
fi;
echo "$FAILUREMESSAGE" >> "$SACONFIG/failed_update"
Please fix the problem and then remove
$SACONFIG/failed_update
EOF
+ rm -rf "$TMPDIR"
exit 1;
}
fi;
mv "$SACONFIG" "$BAKDIR/spamassassin_config_r$ORIGREV"
mv "$TMPDIR/spamassassin_config" "$SACONFIG"
-trap ERR
+trap - ERR
remove_pidfile
rm -rf "$TMPDIR"
if [ "$HOSTNAME" == "rietz" ]; then
touch /home/debbugs/.spamassassin/user_prefs
-elif [ "$HOSTNAME" == "murphy" ]; then
+elif [ "$HOSTNAME" == "liszt" ]; then
# do nothing
+ true;
else
echo "Unknown hostname '$HOSTNAME'";
exit 1;