Test

Any registration / login issues, or anything you want to test can be done so here!

Moderator: CricketMX Forum Moderators

Test

Postby battye » Fri Feb 03, 2006 1:56 pm

I cleaned it up just a little. This code will produce the url you need to access, after you swap out the username and password.


Code: Select all
#!/bin/bash
#File name: CmxUptime.sh
UPSECONDS="`cut -f1 -d'.' /proc/uptime`"
let UPDAYS="${UPSECONDS} / 86400"
let UPHOURS="(${UPSECONDS} % 86400) / 3600"
let UPMINUTES="((${UPSECONDS} % 86400) % 3600) / 60"
echo -n "uptime.cricketmx.com/upload.php?"

echo -n "username=nesman64&password=passvord"
if [ "${UPDAYS}" -ne "0" ];
then
    echo -n "&days=${UPDAYS}"
fi
if [ "${UPHOURS}" -ne "0" ];
then
    echo -n "&hours=${UPHOURS}"
fi
echo "&minutes=${UPMINUTES}"


I use the curl program for this, but wget, lynx, w3m, and who knows what else would work as well.

curl `CmxUptime.sh` > /dev/null 2>&1

You could set this as an entry in cron to have it run whenever.

47 * * * * /usr/bin/curl `/home/nesman/bin/CmxUptime.sh` > /dev/null 2>&1
CricketMX.com.. home of bat's, rat's and other farmyard animals...
My articles: view all articles by battye

"OK, life [as you chose to define it] repeats until there are no more lessons to be learned." - nrnoble (June 12, 2005)
"the new forum looks awesome, it's getting bigger & better" - p2p-sharing-rules (11 Jan, 2008)
"Looks like CMX is not only getting bigger...but, also getting better!!" - moongirl (14 Dec, 2007)
User avatar
battye
Site Admin
Site Admin
 
Posts: 14249
Joined: Sun Jan 11, 2004 8:26 am
Location: Victoria Falls, Zimbabwe

Postby nesman » Sun Feb 05, 2006 5:08 pm

:D
User avatar
nesman
Miracle Worker
Miracle Worker
 
Posts: 1371
Joined: Thu Jan 15, 2004 8:17 am


Return to Testing Forum

Who is online

Users browsing this forum: No registered users and 2 guests

cron