#!/bin/sh
# Steven Shiau <steven@nchc.org.tw>
# License: GPL
# Script to setup DRBL server for the impatient.

# Source function library.
. /etc/rc.d/init.d/functions

# Source DRBL setting
. /opt/drbl/conf/drbl.conf

# Source the drbl related functions
. $DRBL_SCRIPT_PATH/sbin/drbl-functions

check_if_root

#
ask_and_load_lang_set $specified_lang

#
echo "$msg_delimiter_star_line"
echo "$msg_are_you_sure_run_impatient"
echo -n "[Y/n] "
read run_4impatient
case "$run_4impatient" in
	n|N|[nN][oO])
           echo "$msg_delimiter_star_line"
	   echo "$msg_run_step_by_step: "
           echo "(a):\"$DRBL_SCRIPT_PATH/sbin/drblsrv -i\" "
           echo "(b):\"$DRBL_SCRIPT_PATH/sbin/drblpush -i\" "
	   ;;
	*)
           echo "$msg_delimiter_star_line"
	   echo "$msg_run_drbl4imp"
           echo "$msg_press_enter_to_continue"
           read 
           [ -x "$drbl_setup_path/drblsrv" ] && yes "" | $drbl_setup_path/drblsrv -i -l $lang_answer
           [ -x "$drbl_setup_path/drblpush" ] && yes "" | $drbl_setup_path/drblpush -i -l $lang_answer
	   ;;
esac
