Monday, December 22, 2008

My first shell script

I'm the one of English Premiere league fans but my dorminitory doesn't provide TV channel for it. So I have to find out my own. Fortunately, there are several pirate channel available on the internet in the shape of p2p client. One of that is Sopcast

Sopcast provides very easy using application for Windows OS user but it's not me. For Linux user there are a program that can invoke by command line and you have to use your own media player to play it yourself (In fact, there are someone writing linux's front-end Sopcast but it's not work in the way I want)

My problem is that I can't remember the command to run it. Every weekend, I have to open README file of Sopcast for the program running instruction. So I decided to write a script to handle it automatically. And it's also my first shell script ever. Here it is.
#!/bin/sh

echo Start Sopcast at $1
/usr/local/bin/sp-sc $1 3908 8908 > /dev/null &
echo Waiting for Sopcast starting
sleep 10
vlc http://localhost:8908/tv.asf
From now on, any other weekend, no README file. This makes me love not-Windows OS more and more.

No comments:

Config number of file descriptors on Linux

Check file descriptor limit for a process. Vary depending on owner of the process $ cat /proc/{process-id}/limits Check current number of...