Include utils

This commit is contained in:
Bob Mottram 2016-10-08 12:47:07 +01:00
parent bc6431a8ce
commit d13ce3fea9
2 changed files with 21 additions and 3 deletions

View File

@ -42,6 +42,18 @@ fi
source $PROJECT_INSTALL_DIR/${PROJECT_NAME}-vars
UTILS_FILES=/usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-*
for f in $UTILS_FILES
do
source $f
done
APP_FILES=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-*
for f in $APP_FILES
do
source $f
done
command_options=$1
if [[ $command_options == "menuconfig-full" ]]; then
@ -237,6 +249,10 @@ function parse_args {
exit 0
fi
read_config_param 'DEFAULT_DOMAIN_NAME'
read_config_param 'MY_USERNAME'
read_config_param 'SYSTEM_TYPE'
if [ ! -d /home/$MY_USERNAME ]; then
echo $"There is no user '$MY_USERNAME' on the system. Use 'adduser $MY_USERNAME' to create the user."
exit 1

View File

@ -31,9 +31,11 @@
function read_config_param {
param_name="$1"
if [ -f $CONFIGURATION_FILE ]; then
if grep -q "$param_name" $CONFIGURATION_FILE; then
$param_name=$(grep "$param_name" $CONFIGURATION_FILE | head -n 1 | awk -F '=' '{print $2}')
if [ $CONFIGURATION_FILE ]; then
if [ -f $CONFIGURATION_FILE ]; then
if grep -q "${param_name}" $CONFIGURATION_FILE; then
${param_name}=$(cat $CONFIGURATION_FILE | grep "${param_name}=" | head -n 1 | awk -F '=' '{print $2}')
fi
fi
fi
}