From 2ebc77179973055a59d155cdfad265b237c99eb3 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 17 Feb 2014 19:13:39 +0100 Subject: mltk now sources file "config" on start You can put pretty much anything there, but there are two main uses for now: Setting an http proxy: export http_proxy=1.2.3.4:8080 (wget will obey this env var) Setting a custom URL for fetching the distro logo: CFG_DISTLOGO_URL=http://somewhere/distlogo?distro= (Defaults to mltk-services.ruf.uni-freiburg.de/... if unset) Same could be done in openslx if it would be useful... --- config | 2 ++ mltk | 2 ++ remote/rootfs/rootfs-stage32/rootfs-stage32.build | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 config diff --git a/config b/config new file mode 100644 index 00000000..549cc358 --- /dev/null +++ b/config @@ -0,0 +1,2 @@ +export http_proxy=132.230.4.234:8123 + diff --git a/mltk b/mltk index 4810de06..40dd88d8 100755 --- a/mltk +++ b/mltk @@ -49,6 +49,8 @@ for HELPER in "$ROOT_DIR"/remote/includes/*.inc; do qnd_exit done +# Support sourcing a "config" where you can set up stuff like 'export http_proxy=...' +[ -e "$ROOT_DIR/config" ] && . "$ROOT_DIR/config" banner () { echo -e "\033[38;5;202m\t __ __ __ " diff --git a/remote/rootfs/rootfs-stage32/rootfs-stage32.build b/remote/rootfs/rootfs-stage32/rootfs-stage32.build index a751b8f4..bd6d3106 100644 --- a/remote/rootfs/rootfs-stage32/rootfs-stage32.build +++ b/remote/rootfs/rootfs-stage32/rootfs-stage32.build @@ -123,7 +123,8 @@ post_copy() { if [ ! -s "$TARGET_BUILD_DIR/etc/distro.png" ]; then local DIST=$(lsb_release -si) if [ -n "$DIST" ]; then - wget -O "$TARGET_BUILD_DIR/etc/distro.png" "http://132.230.8.113/distro_logo.php?distro=$DIST" + [ -z "$CFG_DISTLOGO_URL" ] && CFG_DISTLOGO_URL='http://mltk-services.ruf.uni-freiburg.de/distro_logo.php?distro=' + wget -O "$TARGET_BUILD_DIR/etc/distro.png" "${CFG_DISTLOGO_URL}${DIST}" if [ ! -s "$TARGET_BUILD_DIR/etc/distro.png" ]; then rm -f "$TARGET_BUILD_DIR/etc/distro.png" pwarning "Could not download distro-logo" -- cgit v1.2.3-55-g7522