#! /bin/sh #---------------------------------------------------------------------------------- # /var/install/bin/partimg-client-info - show how client should connect # # Copyright (c) 2010 The Eisfair Team, team(at)eisfair(dot)org # # Creation: 2010-10-24 jed # Last Update: $Id$ # # 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. #---------------------------------------------------------------------------------- # read eislib . /var/install/include/eislib # exec 2>/tmp/partimg-client-info-$$.log # set -x partimgfile=/etc/config.d/partimg # load configuration . ${partimgfile} if [ "`get_printmode`" = "tty" ] then clrhome else mecho fi mecho -info "PartImage client connect string" mecho mecho -n '* Package status: ' if [ "${START_PARTIMG}" = "yes" ] then # package enabled mecho -info 'active' cmd_str='' partimg_auth=1 if [ "${PARTIMG_USER_AUTH}" = "yes" ] then # check if active user(s) exist(s) idx=1 while [ ${idx} -le ${PARTIMG_USER_N} ] do eval active='$PARTIMG_USER_'${idx}'_ACTIVE' if [ "${active}" = "yes" ] then partimg_auth=0 break fi idx=`expr ${idx} + 1` done fi mecho -n '* User authentication: ' if [ ${partimg_auth} -eq 0 ] then mecho -info 'active' cmd_str="${cmd_str} -U -P" else mecho -warn 'disabled' cmd_str="${cmd_str} -L" fi mecho -n '* SSL transport: ' if [ "${PARTIMG_SSL_TRANSPORT}" = "yes" ] then mecho -info 'enabled' else mecho -warn 'disabled' cmd_str="${cmd_str} -n" fi # add server name cmd_str="${cmd_str} -s`hostname --fqdn`" if [ "${PARTIMG_PORT}" != "" ] then # add port name cmd_str="${cmd_str} -p${PARTIMG_PORT}" fi cmd_str="`echo ${cmd_str}`" # -sX, - give partimaged server's ip address # -pX, - give partimaged server's listening port # -L - disable login in network mode # -n - disable SSL in network mode # -UX - username to authenticate to server # -PX - password for authentication of user to server mecho mecho '* Recommended client start command:' mecho " partimage ${cmd_str}" else # package disabled mecho -warn 'inactive' mecho ' - No connections accepted because package has been disabled!' fi mecho anykey exit 0