Allow passing sources with variables to get_remote_file
authorUlrich Dangel <mru@grml.org>
Sat, 12 Sep 2009 21:56:08 +0000 (23:56 +0200)
committerUlrich Dangel <mru@grml.org>
Sat, 12 Sep 2009 21:56:08 +0000 (23:56 +0200)
Now it is possible to use somethling like netconfig=server.tld/config-$ARCH.tbz
Fixed and updated documentation for netscript/netconfig

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

index 621ef1f..c9e4ff5 100755 (executable)
@@ -1796,7 +1796,7 @@ config_services(){
 # {{{ remote files
 get_remote_file() {
   [ "$#" -eq 2 ] || ( echo "Error: wrong parameter for get_remote_file()" ; return 1 )
-  SOURCE="$1"
+  SOURCE=$(eval echo "$1")
   TARGET="$2"
   getconfig() {
   wget --timeout=10 --dns-timeout=10  --connect-timeout=10 --tries=1 \
index 86c9c5c..5f1b8af 100644 (file)
@@ -120,12 +120,6 @@ 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
@@ -234,9 +228,21 @@ partconf::
 netconfig::
 
     Use this parameter to restore configuration using wget to download a GCA
-    from the specified destination. Usage example:
+    from the specified destination. You can also add variables to change the
+    file name depending on the host configuration. Predefined and useful
+    variables are $ARCH, $HOSTNAME and $KERNEL. Usage example:
 
   netconfig=server.tld/path/to/config.tbz  =>   restore configuration using wget to download file config.tbz
+  netconfig=server.tld/config-$ARCH.tbz    =>   download config for specified architecture
+
+netscript::
+    Use this parameter to download and run a script from specified destination:
+    You can also add variables to change the file name depending on the host
+    configuration. Predefined and useful variables are $ARCH, $HOSTNAME and
+    $KERNEL. Usage example:
+
+  netcript=server.tld/path/to/script       =>   download and run script/executable from server
+  netscript=server.tld/script-$HOSTNAME    =>   download and run script/executable for specific host
 
 extract::