Export TARGET_HOSTNAME before running post-scripts
authorStefan Schlesinger <sts@ono.at>
Thu, 15 Dec 2016 17:45:08 +0000 (18:45 +0100)
committerGitHub <noreply@github.com>
Thu, 15 Dec 2016 17:45:08 +0000 (18:45 +0100)
Export $HOSTNAME in TARGET_HOSTNAME so one is able to do customize things based upon the hostname of the installed machine (eg. to populate /e/n/interfaces by doing a external database lookup).

grml-debootstrap

index 5b5ad44..b158645 100755 (executable)
@@ -1530,8 +1530,9 @@ execute_pre_scripts() {
 
 # execute all scripts in /etc/debootstrap/post-scripts/ {{{
 execute_post_scripts() {
 
 # execute all scripts in /etc/debootstrap/post-scripts/ {{{
 execute_post_scripts() {
-  # make sure we have $MNTPOINT available for our scripts
+  # make sure we have $MNTPOINT and HOSTNAME available for our scripts
   export MNTPOINT
   export MNTPOINT
+  export TARGET_HOSTNAME=$HOSTNAME
 
   if [ -d "$_opt_scripts" ] || [ "$SCRIPTS" = 'yes' ] ; then
     # legacy support for /etc/debootstrap/scripts/
 
   if [ -d "$_opt_scripts" ] || [ "$SCRIPTS" = 'yes' ] ; then
     # legacy support for /etc/debootstrap/scripts/