#!/bin/sh . /etc/functions.sh apply_config() { config_get init "$1" init config_get exec "$1" exec [ -n "$init" ] && reload_init "$2" "$init" [ -n "$exec" ] && reload_exec "$2" "$exec" } reload_exec() { [ -x $2 ] && { echo "Reloading $1... " $2 >/dev/null 2>&1 || echo "!!! Failed to reload $1 !!!" } } reload_init() { [ -x /etc/init.d/$2 ] && /etc/init.d/$2 enabled && { echo "Reloading $1... " /etc/init.d/$2 reload >/dev/null 2>&1 || echo "!!! Failed to reload $1 !!!" } } config_load ucitrack for i in $* do config_foreach apply_config $i $i echo "done." done