#!/bin/bash # ------- # File: llxcfg-showvars # Description: Simple script to read configuration variables for LliureX, it # takes a list of variable names as input and prints them on a # format suitable for source them from a shell script # Author: Sergio Talens-Oliag # Copyright: (c) 2005 Sergio Talens-Oliag # # Modifications: May 2006, Luis Garcia # SVN Id: $Id: llxcfg-showvars 6192 2006-05-12 06:16:38Z lgarcia $ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston MA 02110-1301 USA # -------- set -e PATH="/usr/sbin:/usr/bin:/sbin:/bin" # VARIABLES SCRIPTS_DIR="/usr/share/llxcfg/scripts.d" # FUNCTIONS exit_message(){ echo "$1" >&2 exit 0 } # MAIN PROGRAM VARS_LIB_FILE="/usr/sbin/llxcfg-vars.sh" [ -e ${VARS_LIB_FILE} ] || exit_message "Missing variable library file ${VARS_LIB_FILE}!!" . ${VARS_LIB_FILE} # Initial test [ "$#" -lt "1" ] && exit_message "Usage: $0 LIST_OF_VARIABLES" # Run pre-read scripts [ -d "$SCRIPTS_DIR" ] && run-parts "$SCRIPTS_DIR" llxcfg_vars_show "`llxcfg_vars_files`" $@ exit 0