A few weeks ago, there was a post on this blog introducing
scripting_flexibility.txt
. In order to understand what follows, please read
that post first.
In addition to the numbered commands described in that previous post, these
few lines are also in scripting_flexibilty.txt
:
d-i preseed/numbered_early_command_0 string for S in \ '#!/bin/sh -e' \ '' \ 'URL="${1}"' \ 'FILE="`mktemp -d`/${URL##*/}"' \ 'wget -qO "${FILE}" "${URL}" && \' \ ' sh "${FILE}"'; \ do \ echo "${S}" >> /bin/wget+sh; \ done; chmod +x /bin/wget+sh
As can be seen, the command creates the executable shell script /bin/wget+sh
,
which can then be used from preseed files to fetch and execute scripts with one
short command.