added new bootparameter netscript
authorUlrich Dangel <mru@grml.org>
Fri, 11 Sep 2009 23:02:06 +0000 (01:02 +0200)
committerUlrich Dangel <mru@grml.org>
Fri, 11 Sep 2009 23:25:17 +0000 (01:25 +0200)
introduced new bootpara netscript for downloading and running a executable
from a remote host

autoconfig
autoconfig.functions
doc/grml-autoconfig.1.txt
grml-autoconfig

index 363fa80..10ea222 100644 (file)
@@ -95,6 +95,7 @@ CONFIG_MOUSE='yes'            # show mouse information (expert-mode)
 CONFIG_MYCONFIG='yes'         # check if we want the config floppy
 CONFIG_MYPATH='yes'           # provide setting additional paths via bootoption mypath
 CONFIG_NETCONFIG='yes'        # download configuration archive provided by bootoption netconfig=...
+CONFIG_NETSCRIPT='yes'        # download and run script/executable provided by bootoption netscript=...
 CONFIG_NETIPV6='yes'          # check for bootparam ipv6
 CONFIG_PARTCONF='yes'        # do we want partconf to work?
 CONFIG_PASSWD='yes'           # set password via bootparam passwd
index 13f32f0..b1f8933 100755 (executable)
@@ -1834,6 +1834,21 @@ config_netconfig(){
 }
 # }}}
 
+# {{{ remote scripts
+config_netscript() {
+ if checkbootparam 'netscript' ; then
+  CONFIG="$(getbootparam 'netscript' 2>>$DEBUG)"
+  SCRIPTFILE='/tmp/netscript.grml'
+
+  if get_remote_file ${CONFIG} ${SCRIPTFILE} ; then
+    chmod +x ${SCRIPTFILE}
+    einfo "Running ${WHITE}${SCRIPTFILE}${NORMAL}:" && ${SCRIPTFILE} ; eend $?
+  fi
+
+ fi
+}
+# }}}
+
 # {{{ blindsound
 config_blindsound(){
  if checkbootparam 'blind' ; then
index 88dcbdb..86c9c5c 100644 (file)
@@ -120,6 +120,12 @@ netconfig::
 
   netconfig=server.tld/path/to/config.tbz  =>   restore configuration using wget to download file config.tbz
 
+netscript::
+    Use this parameter to download and run a script from specified
+    destination: Usage example:
+
+  netcript=server.tld/path/to/script       =>   download and run script/executable from server
+
 extract::
 
     Extract specific directories from configuration archive. Notice: This
index a53d2c5..b5556d1 100755 (executable)
@@ -232,6 +232,8 @@ checkvalue $CONFIG_SERVICES && config_services
 
 checkvalue $CONFIG_NETCONFIG && config_netconfig
 
+checkvalue $CONFIG_NETSCRIPT && config_netscript
+
 checkvalue $CONFIG_NETIPV6 && config_ipv6
 
 checkvalue $CONFIG_DEBNET && config_debnet