#!/bin/sh version="$1" ; shift image="$1" ; shift for s in `systemctl show kexec.target | sed -nre 's/^Wants=(.*)/\1/p'` ; do case "${s}" in kexec-load@*) systemctl disable "${s}" ;; esac done exec systemctl enable kexec-load@"${version}"