- else
- beautify message FAIL
- fi
- rm -f /tmp/ipfire_mail_body $ATTACHMENT
-}
-
-make_config() {
- clear
- echo -e "${BOLD}***This will create your configuration...${NORMAL}"
- echo -ne "***If your are ready press <ENTER>!"
- read
- clear
- echo -ne "***The buildscript will create a full iso image.\n"
- echo -ne "***If you want to skip any package please enter its name here seperated with space.\n"
- echo -ne "Actually in the list are: $SKIP_PACKAGE_LIST\n"
- echo -ne "Do you want to change this? (y/N) "
- read YESNO
- if [ "$YESNO" == "y" ]; then
- echo -ne "Please type: "
- read SKIP_PACKAGE_LIST
- echo -ne "You entered: $SKIP_PACKAGE_LIST\n"
- fi
-
- clear
- echo -ne "***When you have compiled successfully, there is the possibility\n"
- echo -ne "***to upload the iso image to a ftp server.\n"
- echo -ne "***If the url is empty there will be no upload.\n"
- echo -ne "Actually there is: $FTP_ISO_URL\n"
- echo -ne "Do you want to change this? (y/N) "
- read YESNO
- if [ "$YESNO" == "y" ]; then
- echo -ne "Please type the url: "
- read FTP_ISO_URL
- echo -ne "Please type the path: "
- read FTP_ISO_PATH
- echo -ne "Please type the username: "
- read FTP_ISO_USER
- echo -ne "Please type the password (hidden): "
- read -s FTP_ISO_PASS
-
- fi
-
- clear
- echo -ne "***When you add some new software you can easyly\n"
- echo -ne "***upload the source code to our repository server.\n"
- echo -ne "***If the url is empty there will be no upload.\n"
- echo -ne "Actually there is: $FTP_CACHE_URL\n"
- echo -ne "Do you want to change this? (y/N) "
- read YESNO
- if [ "$YESNO" == "y" ]; then
- echo -ne "Please type the url: "
- read FTP_CACHE_URL
- echo -ne "Please type the path: "
- read FTP_CACHE_PATH
- echo -ne "Please type the username: "
- read FTP_CACHE_USER
- echo -ne "Please type the password (hidden): "
- read -s FTP_CACHE_PASS
-
- fi
-
- clear
- echo -ne "***If there are some important messages you\n"
- echo -ne "***can get a notification mail.\n"
- echo -ne "***Please type one ore more email adresses (seperated by comma).\n"
- echo -ne "Actually there is: $MAIL_TO\n"
- echo -ne "Do you want to change this? (y/N) "
- read YESNO
- if [ "$YESNO" == "y" ]; then
- echo -ne "Please type: "
- read MAIL_TO
- echo -ne "You should enter a mail server to login...\n"
- echo -ne "Please type the url: "
- read MAIL_SERVER
- echo -ne "Please type the username: "
- read MAIL_USER
- echo -ne "Please type the password (hidden): "
- read -s MAIL_PASS
-
- fi
- echo -ne "\n${BOLD}***Saving...${NORMAL}"
- cat <<END > $BASEDIR/.config
-### iso server
-FTP_ISO_URL=$FTP_ISO_URL
-FTP_ISO_PATH=$FTP_ISO_PATH
-FTP_ISO_USER=$FTP_ISO_USER
-FTP_ISO_PASS=$FTP_ISO_PASS
-### cache server
-FTP_CACHE_URL=$FTP_CACHE_URL
-FTP_CACHE_PATH=$FTP_CACHE_PATH
-FTP_CACHE_USER=$FTP_CACHE_USER
-FTP_CACHE_PASS=$FTP_CACHE_PASS
-### mail reports
-MAIL_TO="$MAIL_TO"
-MAIL_SERVER=$MAIL_SERVER
-MAIL_USER=$MAIL_USER
-MAIL_PASS=$MAIL_PASS
-### misc
-SKIP_PACKAGE_LIST="$SKIP_PACKAGE_LIST"
-END
- beautify message DONE
-}
-
-compile_tftpd() {
- mkdir $BASEDIR/tmp
- tar xvfz $BASEDIR/cache/tftp-hpa-0.42.tar.gz -C $BASEDIR/tmp
- cd $BASEDIR/tmp/tftp-hpa-*
- ./configure --prefix=/ipfire/trunk/tools/ \
- --sbindir=/ipfire/trunk/tools/ --disable-nls
- make
- install -c tftpd/tftpd $BASEDIR/tools/in.tftpd
- cd -
- rm -rf $BASEDIR/tmp/tftp-hpa-*
-}
-
-start_tftpd() {
- if [ ! -e $BASEDIR/tools/in.tftpd ]; then
- compile_tftpd
- fi
- reload_tftpd
- if [ "$?" == "0" ]; then
- $BASEDIR/tools/in.tftpd -l -s $BASEDIR/tftpboot
- beautify message DONE
- else
- echo -en "You don not have a pxe boot image in your base directory.\nPlease compile first."
- beautify message FAIL
- exit 1
- fi
-}
-
-stop_tftpd() {
- echo -n "Stopping TFTPD..."
- killall in.tftpd >/dev/null 2>&1
- sleep 3
- killall -9 in.tftp >/dev/null 2>&1
- beautify message DONE
-}
-
-reload_tftpd() {
- if [ -e $BASEDIR/ipfire-$VERSION.$MACHINE-pxe.tgz ]; then
- mkdir -p $BASEDIR/tftpboot
- tar xfz $BASEDIR/ipfire-$VERSION.$MACHINE-pxe.tgz -C $BASEDIR/tftpboot
- return 0
- fi
- return 1