#!/bin/sh echo "Don't forget to update this script with the change-log! Press ENTER to start..." read NAME="vnstat" VERSION="1.10" SOURCE="http://humdi.net/vnstat/vnstat-$VERSION.tar.gz" CONFIGURE="--prefix=/usr/local" DATE=`date '+%Y/%m/%d'` export CFLAGS="-march=i486 -mtune=i686 -Os -pipe" export CXXFLAGS="-march=i486 -mtune=i686 -Os -pipe" export LDFLAGS="-Wl,-O1" echo "Downloading essential packages..." tce-load -wi compiletc squashfs-tools-4.x cd /tmp/ wget $SOURCE sudo rm -rf $NAME-$VERSION 2>/dev/null sudo rm /tmp/$NAME.tcz /tmp/$NAME.tcz.list /tmp/$NAME.tcz.md5.txt /tmp/$NAME.tcz.dep 2>/dev/null sudo rm -rf /tmp/$NAME 2>/dev/null sudo rm /tmp/$NAME-doc.tcz /tmp/$NAME-doc.tcz.list /tmp/$NAME-doc.tcz.md5.txt /tmp/$NAME-doc.tcz.dep 2>/dev/null sudo rm -rf /tmp/$NAME-doc 2>/dev/null tar xvfz $NAME-$VERSION.tar.gz cd $NAME-$VERSION echo "Press ENTER to continue... " read make -j3 echo " Starting make install to: /tmp/$NAME" sudo make DESTDIR=/tmp/$NAME install cd /tmp/$NAME sudo find . | xargs file | grep "executable" | grep ELF | grep "not stripped" | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null sudo find . | xargs file | grep "shared object" | grep ELF | grep "not stripped" | cut -f 1 -d : | xargs strip -g 2> /dev/null sudo mkdir -p /tmp/$NAME/usr/local/etc/init.d sudo mkdir -p /tmp/$NAME-doc/usr/local/ sudo mv /tmp/$NAME-$VERSION/examples/init.d/debian/vnstat /tmp/$NAME/usr/local/etc/init.d/ cd /tmp/$NAME/ sudo mv etc/vnstat.conf usr/local/etc/ sudo rm -rf etc cd usr sudo mv bin local/ sudo mv sbin local/ sudo mv share /tmp/$NAME-doc/usr/local/ #Modify init script to our needs: sudo sed -i -e "s/MaxBandwidth 100/MaxBandwidth 0/" /tmp/$NAME/usr/local/etc/vnstat.conf sudo sed -i -e "s/PATH=\/usr\/sbin:\/usr\/bin:\/sbin:\/bin/PATH=\/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/sbin:\/bin/" /tmp/$NAME/usr/local/etc/init.d/vnstat sudo sed -i -e "s/DAEMON=\/usr\/sbin\/\$NAME/DAEMON=\/usr\/local\/sbin\/\$NAME/" /tmp/$NAME/usr/local/etc/init.d/vnstat sudo sed -i -e "s/SCRIPTNAME=\/etc\/init.d\/vnstat/SCRIPTNAME=\/usr\/local\/etc\/init.d\/vnstat/" /tmp/$NAME/usr/local/etc/init.d/vnstat echo "Creating package..." cd /tmp/ sudo mksquashfs $NAME $NAME.tcz sudo md5sum $NAME.tcz > $NAME.tcz.md5.txt cd $NAME sudo find usr -not -type d > ../$NAME.tcz.list cd /tmp/ SIZE="`du -k $NAME.tcz|cut -f1`k" sudo echo "Title: $NAME.tcz Description: vnStat Version: $VERSION Author: Teemu Toivola Original-site: http://humdi.net/vnstat/ Copying-policy: GPLv2 Size: $SIZE Extension_by: andriscom Comments: Console-based network traffic monitor that keeps a log of network traffic for the selected interface(s). It uses the network interface statistics provided by the kernel as information source. This means that vnStat won't actually be sniffing any traffic and also ensures light use of system resources. Create databases for your interfaces: sudo vnstat -u -i eth0 --force --config /usr/local/etc/vnstat.conf sudo vnstat -u -i eth1 --force --config /usr/local/etc/vnstat.conf sudo vnstat -u -i ppp0 --force --config /usr/local/etc/vnstat.conf etc... Start vnstat daemon to update the database regulary: sudo /usr/local/etc/init.d/vnstat start Once the database built for your(s) device(s), call vnstat as user. example for hourly output: vnstat -h example for daily output: vnstat -d example for weekly output: vnstat -w Built with CFLAGS: -march=i486 -mtune=i686 -Os -pipe Built with CXXFLAGS: -march=i486 -mtune=i686 -Os -pipe Built with LDFLAGS: -Wl,-O1 This extension is PPI Compatible. Just add usr/local/etc/vnstat.conf; var/lib/vnstat into your /opt/.filetool.lst There are several web frontends avaliable for vnstat. Check the homepage for more info. Restrictions: Updates needs to be executed at least as often as it is possible for the interface to generate enough traffic to wrap the kernel interface traffic counter. Otherwise it is possible that some traffic won't be seen. This isn't an issue for 64 bit kernels but at least one update every hour is always required in order to provide proper input. With 32 bit kernels the maximum time between two updates depends on how fast the interface can transfer 4 GiB. Calculated theoretical times are: 10 Mbit: 54 minutes 100 Mbit: 5 minutes 1000 Mbit: 30 seconds Estimated traffic values are likely to be somewhat inaccurate if daily traffic is low because only the MiB counter is used to calculate the estimate. Source: $SOURCE Change-log: 2009/07/09 Original version by alu (1.8) $DATE Version: $VERSION Current: $DATE Version: $VERSION " > $NAME.tcz.info echo "Creating doc package..." cd /tmp/ sudo mksquashfs $NAME-doc $NAME-doc.tcz sudo md5sum $NAME-doc.tcz > $NAME-doc.tcz.md5.txt cd $NAME-doc sudo find usr -not -type d > ../$NAME-doc.tcz.list cd /tmp/ SIZE="`du -k $NAME-doc.tcz|cut -f1`k" sudo echo "Title: $NAME-doc.tcz Description: vnStat man pages Version: $VERSION Author: Teemu Toivola Original-site: http://humdi.net/vnstat/ Copying-policy: GPLv2 Size: $SIZE Extension_by: andriscom Comments: Console-based network traffic monitor that keeps a log of network traffic for the selected interface(s). It uses the network interface statistics provided by the kernel as information source. This means that vnStat won't actually be sniffing any traffic and also ensures light use of system resources. This package contains the man pages. Source: $SOURCE Change-log: 2009/07/09 Original version by alu (1.8) $DATE Version: $VERSION Current: $DATE Version: $VERSION " > $NAME-doc.tcz.info sudo echo "vnstat.tcz " > $NAME-doc.tcz.dep cd /tmp/ mkdir packages 2>/dev/null sudo rm packages/$NAME.tar.gz 2>/dev/null tar zcf packages/$NAME.tar.gz $NAME.tcz* sudo rm packages/$NAME-doc.tar.gz 2>/dev/null tar zcf packages/$NAME-doc.tar.gz $NAME.tcz* echo " Run bcrypt on /tmp/packages/*.tar.gz... give password: tinycore" echo "Run the extension_audit.sh and reboot a clean system to try the packages!" echo "Send it to: tcesubmit@gmail.com" sys.exit(1) else: raise " > /tmp/htdigest.py sudo chmod +x /tmp/htdigest.py sudo mv /tmp/htdigest.py /tmp/$NAME/usr/local/sbin/htdigest.py echo "Creating package..." cd /tmp/ sudo mksquashfs $NAME $NAME.tcz sudo md5sum $NAME.tcz > $NAME.tcz.md5.txt cd $NAME sudo find usr -not -type d > ../$NAME.tcz.list cd /tmp/ SIZE="`du -k $NAME.tcz|cut -f1`k" sudo echo "Title: $NAME.tcz Description: Cherokee Web Server Version: $VERSION Author: Alvaro Lopez Ortega Original-site: http://www.cherokee-project.com/ Copying-policy: GPL Size: $SIZE Extension_by: andriscom Comments: Cherokee is a lighweight, very fast, flexible and easy to configure Web Server. Its performance is comparable to nginx, with less RAM utilized under high load. It supports: FastCGI, SCGI, PHP, CGI, SSI, TLS and SSL encrypted connections, Virtual hosts, Authentication, on the fly encoding, Load Balancing, Apache compatible log files, Data Base Balancing, Reverse HTTP Proxy, Traffic Shaper and others. An optional user friendly interface called cherokee-admin is provided for a no-hassle browser-based configuration of the server. The conf file can also be edited manually. Check out the benchmarks and documentation to learn more, and give it a try to squeeze your hardware to the fullest! This extension is PPI Compatible. Just add /usr/local/etc/cherokee/cherokee.conf into your /opt/.filetool.lst Built with CFLAGS: -march=i486 -mtune=i686 -Os -pipe Built with CXXFLAGS: -march=i486 -mtune=i686 -Os -pipe Built with LDFLAGS: -Wl,-O1 Built with the following options: ./configure $CONFIGURE There are some optional dependencies that are not included to keep Cherokee lightweight. These packages are requied to get the following functionality: PHP: php5.tcz Mod TLS: openssl-0.9.8.tcz Streaming: ffmpeg-ffserver.tcz Cherokee-admin WebGUI: python.tcz htdigest.py: python.tcz Generate server certificate and key for Mod TLS: sudo openssl req -new -x509 -days 1460 -nodes -out /usr/local/etc/cherokee/cherokee.cert.pem -keyout /usr/local/etc/cherokee/cherokee.key.pem To create authorized user: (Digest) htdigest.py -c /usr/local/etc/cherokee.passwd \"Realm name\" username -b password To control Cherokee: sudo /usr/local/etc/init.d/cherokee [start|stop|reload|rotate-logs|restart|force-restart] Source: $SOURCE Change-log: 2009/10/16 Original version by evofx (0.99.24) $DATE Version: $VERSION Current: $DATE Version: $VERSION " > $NAME.tcz.info sudo echo "pcre.tcz " > $NAME.tcz.dep echo "Creating doc package..." cd /tmp/ sudo mksquashfs $NAME-doc $NAME-doc.tcz sudo md5sum $NAME-doc.tcz > $NAME-doc.tcz.md5.txt cd $NAME-doc sudo find usr -not -type d > ../$NAME-doc.tcz.list cd /tmp/ SIZE="`du -k $NAME-doc.tcz|cut -f1`k" sudo echo "Title: $NAME-doc.tcz Description: Cherokee man pages Version: $VERSION Author: Alvaro Lopez Ortega Original-site: http://www.cherokee-project.com/ Copying-policy: GPL Size: $SIZE Extension_by: andriscom Comments: Manual entry files and HTML documentation for Cherokee $VERSION. Source: $SOURCE Change-log: 2009/10/16 Original version by evofx (0.99.24) $DATE Version: $VERSION Current: $DATE Version: $VERSION " > $NAME-doc.tcz.info sudo echo "cherokee.tcz " > $NAME-doc.tcz.dep echo "Creating locale package..." cd /tmp/ sudo mksquashfs $NAME-locale $NAME-locale.tcz sudo md5sum $NAME-locale.tcz > $NAME-locale.tcz.md5.txt cd $NAME-locale sudo find usr -not -type d > ../$NAME-locale.tcz.list cd /tmp/ SIZE="`du -k $NAME-locale.tcz|cut -f1`k" sudo echo "Title: $NAME-locale.tcz Description: Cherokee locale files Version: $VERSION Author: Alvaro Lopez Ortega Original-site: http://www.cherokee-project.com/ Copying-policy: GPL Size: $SIZE Extension_by: andriscom Comments: Locale files for Cherokee $VERSION. Source: $SOURCE Change-log: 2009/10/16 Original version by evofx (0.99.24) $DATE Version: $VERSION Current: $DATE Version: $VERSION " > $NAME-locale.tcz.info sudo echo "cherokee.tcz " > $NAME-locale.tcz.dep cd /tmp/ mkdir packages 2>/dev/null sudo rm packages/$NAME.tar.gz 2>/dev/null tar zcf packages/$NAME.tar.gz $NAME.tcz* sudo rm packages/$NAME-doc.tar.gz 2>/dev/null tar zcf packages/$NAME-doc.tar.gz $NAME-doc.tcz* sudo rm packages/$NAME-locale.tar.gz 2>/dev/null tar zcf packages/$NAME-locale.tar.gz $NAME-locale.tcz* echo " Run bcrypt on /tmp/packages/*.tar.gz... give password: tinycore" echo "Run the extension_audit.sh and reboot a clean system to try the packages!" echo "Send it to: tcesubmit@gmail.com"