From 1e3aa3c8b960b89100a913e11e23f46df4ec1516 Mon Sep 17 00:00:00 2001 From: Ulrich Dangel Date: Sat, 12 Sep 2009 23:56:08 +0200 Subject: [PATCH] Allow passing sources with variables to get_remote_file Now it is possible to use somethling like netconfig=server.tld/config-$ARCH.tbz Fixed and updated documentation for netscript/netconfig --- autoconfig.functions | 2 +- doc/grml-autoconfig.1.txt | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/autoconfig.functions b/autoconfig.functions index 621ef1f..c9e4ff5 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -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 \ diff --git a/doc/grml-autoconfig.1.txt b/doc/grml-autoconfig.1.txt index 86c9c5c..5f1b8af 100644 --- a/doc/grml-autoconfig.1.txt +++ b/doc/grml-autoconfig.1.txt @@ -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:: -- 2.1.4