BASH   33
post install script MailScanner
Guest on 9th February 2023 02:04:59 PM


  1. #!/bin/bash
  2. # Thomas Chung
  3. # Upgrade Notes - Some of the virus scanner "wrapper" and "autoupdate" scripts have been updated in new version.
  4. # If upgrading from earlier versions using the RPM distributions, you will need to manually rename each of the
  5. #  /usr/lib/MailScanner/*.rpmnew files over the top of the old scripts in the same directory
  6.  
  7. echo "renaming new scripts to current scripts..."
  8. cd /usr/lib/MailScanner
  9. if [ -f *.rpmnew ]; then
  10.   for NEW in *-wrapper.rpmnew *-autoupdate.rpmnew
  11.   do
  12.      echo $NEW ...
  13.      F=`echo $NEW | sed -e 's/\.rpmnew//'`
  14.      [ -f $F ] && mv -f $F ${F}.rpmold
  15.      mv -f $NEW $F
  16.   done
  17. else
  18.   echo "no new updated scripts were found."
  19. fi
  20.  
  21. echo "upgrading to new MailScanner config..."
  22. cd /etc/MailScanner
  23. /usr/sbin/upgrade_MailScanner_conf MailScanner.conf MailScanner.conf.rpmnew > MailScanner.new
  24. mv MailScanner.conf MailScanner.old
  25. mv MailScanner.new  MailScanner.conf
  26.  
  27. echo "stopping sendmail and starting MailScanner..."
  28. service sendmail stop
  29. chkconfig sendmail off
  30. chkconfig --level 2345 MailScanner on
  31. service MailScanner start
  32.  
  33. echo "Done!"

Raw Paste

Login or Register to edit or fork this paste. It's free.