#---------------------------------------------------------------------------- # /var/install/include/check-eisfair-version - check installed version # # Creation : 2007-12-18 hbfl # Last Update: $Id$ # # Copyright (c) 2007-@@YEAR@@ the eisfair team, team(at)eisfair(dot)org # # 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. #---------------------------------------------------------------------------- # --------------------------------------------------------------------------- # check first if eislib is included # --------------------------------------------------------------------------- . /var/install/include/eislib # --------------------------------------------------------------------------- # select system version # --------------------------------------------------------------------------- # list systems to select systems="eisfair-1 eisxen-1 eisfair-64 eisfair-armhf" etc_system_file=/etc/eisfair-system check_system() { clrhome # display systems to select on tty mecho --info "Can't detect the system type," mecho --info "please select one first." echo echo echo "${systems}" | /usr/bin/gawk '{ printf ("%6s. %s\n", FNR, $1) }' echo echo /var/install/bin/ask "Select" "${system_to_work}" "1-$(echo "${systems}" | /usr/bin/wc -l)" "^$=Return" "0=Exit" >/tmp/ask.$$ rc=${?} read system_to_work ${etc_system_file} EISFAIR_SYSTEM=${system_work} # export EISFAIR_SYSTEM to check it once export EISFAIR_SYSTEM ;; esac } # check ${etc_system_file} exists if [ ! -f ${etc_system_file} ] then # if not exists check_system else # if exists, read entry system_work="$(/usr/bin/gawk '{ print $1 }' ${etc_system_file})" # check if ${etc_system_file} entry broken if $(echo "${systems}" | /usr/bin/grep -q "${system_work}$") then # if not broken EISFAIR_SYSTEM="${system_work}" # export EISFAIR_SYSTEM to check it once export EISFAIR_SYSTEM else # if broken check_system fi fi # --------------------------------------------------------------------------- # end # ---------------------------------------------------------------------------