X-Git-Url: https://git.grml.org/?p=grml-autoconfig.git;a=blobdiff_plain;f=autoconfig.functions;h=c9e4ff54bff7b685391e88ed1468141258ffc76f;hp=13f32f05cb052e6f99927c46c69dc3ab6ee326e7;hb=f9f92864d1e46ceeb77297fe8f13405c1a6c8d2f;hpb=811e324061df4f7cf49a7faf61736e23427f3bdf diff --git a/autoconfig.functions b/autoconfig.functions index 13f32f0..c9e4ff5 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -10,6 +10,7 @@ export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin" DEBUG="/dev/null" KERNEL="$(uname -r)" +ARCH="$(uname -m)" umask 022 # old linuxrc version: @@ -1795,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 \ @@ -1834,6 +1835,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