Monday, April 23, 2007

Dbhub Startup scripts

File sharing ,wareze anime is common in the local university here in Malaysia . While I'm not really against it, piracy is bad people. It shows we don't have respect for the community around us.

Currently the hottest p2p sharing system in my university is via DC++ . Initially i just playing around with the server file just for fun but who knows what revolution had i made around here lol. I got variou Pm on how the heck did i keep it running automatically? Well the secrets lies in two things. crontab and bash . How simple can you get?

here's the code :


#!/bin/bash
RUNNING=$(fuser -4n tcp "1411")
if test -z "$RUNNING" ; then
sleep 5
dbhub
fi

save the file as dbstart.

# chmod 700 dbstart ;
# crontab -e

Add this line

0-59/5 * * * * /home/your_username/dbstart >/dev/null 2>&1



That`s all i`m too lazy to eloborate.

No comments: