# feel free to remove functions you don't need. comments, too

post_upgrade()
{
  if [ -L /etc/systemd/system/printer.target.wants/cups.service ]; then
	echo "CUPS changed service name of cups.service. Stopgging, reloading systemd and enabling new one"
	systemctl stop cups.service
	systemctl disable cups.service
	systemctl daemon-reload
	systemctl enable org.cups.cupsd.service
  fi

  if [ -L /etc/systemd/system/sockets.target.wants/cups.socket ]; then
        echo "CUPS changed service name of cups.socket. Stopgging, reloading systemd and enabling new one"
        systemctl stop cups.socket
        systemctl disable cups.socket
        systemctl daemon-reload
        systemctl enable org.cups.cupsd.socket
  fi
  if [ -L /etc/systemd/system/multi-user.target.wants/cups.path ]; then
        echo "CUPS changed service name of cups.path. Stopgging, reloading systemd and enabling new one"
        systemctl stop cups.path
        systemctl disable cups.path
        systemctl daemon-reload
        systemctl enable org.cups.cupsd.path
  fi
}

op=$1
shift
$op $*
