diff options
author | Jon Clausen <jac@nordu.net> | 2018-08-02 08:52:24 +0200 |
---|---|---|
committer | Jon Clausen <jac@nordu.net> | 2018-08-02 08:52:24 +0200 |
commit | 02a92a4c737f3f3d7f5e6d18dd7f8f831a469ce6 (patch) | |
tree | 019279ef4ed3c8a8e97dfeddd6d8daca26f312ab /adapt-ks-template | |
parent | 60f09074b313c94b8b1f2ebdaa4558920e10620b (diff) |
record the generator commandline in the generated files
Diffstat (limited to 'adapt-ks-template')
-rwxr-xr-x | adapt-ks-template | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/adapt-ks-template b/adapt-ks-template index 8661a86..afc31e3 100755 --- a/adapt-ks-template +++ b/adapt-ks-template @@ -116,6 +116,10 @@ function parse_commadline { KrnlCmdLineOpt="$(echo ${2} | sed -e 's/;/ /g')" shift ;; + --gen-cmd) + GeneratorCommand="$(echo ${2} | sed -e 's/;:;/ /g')" + shift + ;; *) echo "what do you mean \"$1\"?" exit 1 @@ -200,6 +204,12 @@ then exit 1 fi +# boilerplate: +sed -ie '1 a #' "${TmpDir}/ks-template" +sed -ie '2 a # This file generated with this command:' "${TmpDir}/ks-template" +sed -ie "3 a # ${GeneratorCommand}" "${TmpDir}/ks-template" +sed -ie '4 a #' "${TmpDir}/ks-template" + # substitutions: sed -ie "s/HOSTNAME/${Host}/g" "${TmpDir}/ks-template" sed -ie "s/DOMAIN/${Domain}/g" "${TmpDir}/ks-template" |