Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Automatic Shutdown

Name: Anonymous 2008-04-26 6:53

I need to find a way to shut down my Linux PC (Ubuntu 8.04 Server) after it has up & downloaded 100MB.
Anyone has any idea on how to do this?

Name: Anonymous 2008-04-26 7:26

#!/bin/bash
RX=`ifconfig | grep -A 6 eth1 | grep "RX bytes" | sed -e "s/\s*RX bytes:\([0-9]*\).*/\1/g"`
TX=`ifconfig | grep -A 6 eth1 | grep "TX bytes" | sed -e "s/.*TX bytes:\([0-9]*\).*/\1/g"`
if [ $RX -ge 104857600 -o $TX -ge 104857600 ]
then
    init 0
fi



Put it in root's crontab.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List