doinst.sh 666 B

12345678910111213141516171819
  1. config() {
  2. NEW="$1"
  3. OLD="`dirname $NEW`/`basename $NEW .new`"
  4. # If there's no config file by that name, mv it over:
  5. if [ ! -r $OLD ]; then
  6. mv $NEW $OLD
  7. elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
  8. rm $NEW
  9. fi
  10. # Otherwise, we leave the .new copy for the admin to consider...
  11. }
  12. # Keep same perms on rc.php-fpm.new:
  13. if [ -e etc/rc.d/rc.php-fpm-8.2 ]; then
  14. cp -a etc/rc.d/rc.php-fpm-8.2 etc/rc.d/rc.php-fpm-8.2.new.incoming
  15. cat etc/rc.d/rc.php-fpm-8.2.new > etc/rc.d/rc.php-fpm-8.2.new.incoming
  16. mv etc/rc.d/rc.php-fpm-8.2.new.incoming etc/rc.d/rc.php-fpm-8.2.new
  17. fi
  18. config etc/rc.d/rc.php-fpm-8.2.new