From: Ulrich Dangel Date: Fri, 11 Sep 2009 23:02:06 +0000 (+0200) Subject: added new bootparameter netscript X-Git-Tag: v0.8.30~1 X-Git-Url: https://git.grml.org/?p=grml-autoconfig.git;a=commitdiff_plain;h=b2d376c8f7805be78101865a423f892ddf074588;ds=sidebyside added new bootparameter netscript introduced new bootpara netscript for downloading and running a executable from a remote host --- diff --git a/autoconfig b/autoconfig index 363fa80..10ea222 100644 --- a/autoconfig +++ b/autoconfig @@ -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 diff --git a/autoconfig.functions b/autoconfig.functions index 13f32f0..b1f8933 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -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 diff --git a/doc/grml-autoconfig.1.txt b/doc/grml-autoconfig.1.txt index 88dcbdb..86c9c5c 100644 --- a/doc/grml-autoconfig.1.txt +++ b/doc/grml-autoconfig.1.txt @@ -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 diff --git a/grml-autoconfig b/grml-autoconfig index a53d2c5..b5556d1 100755 --- a/grml-autoconfig +++ b/grml-autoconfig @@ -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