]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - tools/make-functions
... Viel zu tun :D
[ipfire-2.x.git] / tools / make-functions
index 91b85f63da38135a01941177452ef583cddc9cdf..fb4a8f36eb5b7218b14822dbcaab3140ba022617 100644 (file)
@@ -629,4 +629,48 @@ IPFIRE_MAIL_USER=$IPFIRE_MAIL_USER
 IPFIRE_MAIL_PASS=$IPFIRE_MAIL_PASS
 END
        beautify message DONE
-}
\ No newline at end of file
+}
+
+compile_tftpd() {
+       mkdir $BASEDIR/tmp
+       tar xvfz $BASEDIR/cache/tftp-hpa-0.42.tar.gz -C $BASEDIR/tmp
+       cd $BASEDIR/tmp/tftp-hpa-0.42
+               ./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-0.42
+}
+
+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-pxe-$MACHINE.tgz ]; then
+               mkdir -p $BASEDIR/tftpboot
+               tar xvfz $BASEDIR/ipfire-$VERSION-pxe-$MACHINE.tgz -C $BASEDIR/tftpboot
+               return 0
+       fi
+       return 1
+}