On Tuesday 02 August 2005 08:17, Sujeet Bhatt wrote:
>Can you tell me how linc-daemon works exactly? I have never used it.
>
>Thanks in advance,
>
> Sujeet
Dejavu :P. It seems just yesterday that Philip Tellis was tutoring me on
how to use linc-daemon. I didnt thank him for his wonderful post.
Anyway, its better to be late than never. Thanks Philip :)
Here is his original post:
On Wed Feb 18 17:04:30 IST 2004, Philip S Tellis wrote:
I'm not sure about the rpm, I installed from source, but it should be
the same. If my instructions don't work, then give me the output of
rpm -q linc-daemon
Instructions:
After installing, you should have the following files:
/usr/bin/linc
/etc/lincrc
if you do not have /etc/lincrc, then create it using the command:
touch /etc/lincrc
now, edit this file:
vi /etc/lincrc
My file looks like this:
# Config file for linc cablenet client
srvaddr = 172.16.1.1
srvport = 6060
username = tellis
password = xxxxxxxxxxx
hwaddr = 00:E0:4C:00:03:42
you should change the settings to whatever your operator gives you.
hwaddr is specific to your machine, you can use the ifconfig utility to
find out:
/sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:E0:4C:00:03:42
^^^^^^^^^^^^^^^^^
next, you'll need to configure your resolv.conf file to use the dns
server that your ISP gives you.
finally, I've attached a linc startup script to this mail. You should
copy it to /etc/init.d and run the following commands:
chmod +x /etc/init.d/linc
chkconfig --add linc
chkconfig linc on
This will ensure that linc connects to the net when your machine boots
up. To start linc immediately, run the following command:
/etc/init.d/linc start
to stop linc, run:
/etc/init.d/linc stop
other options can be got by running
/etc/init.d/linc
NOTES:
before you do anything, try and understand how things work.
man linc
man lincrc
will explain a lot
You can also start linc by just running the linc program. This will
start linc on the current console, but in the background. You will have
to send it signals using the kill command, which IMO isn't very user
friendly.
Subscribing to the linc-user's mailing list (on sourceforge) can help.
Philip
--
Let the machine do the dirty work.
-- "Elements of Programming Style", Kernighan and Ritchie
-------------- next part --------------
#!/bin/bash
#
# linc Startup script for the Linc client
#
# Author: Philip Tellis <[EMAIL PROTECTED]>
#
# chkconfig: 2345 20 80
# description: linc is a free multiplatform client for Cyberoam and \
# 24online.
# processname: linc
# pidfile: /var/run/linc.pid
# config: /etc/lincrc
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 1
servaddr=`awk '/srvaddr/ {print $3}' /etc/lincrc`
servport=`awk '/srvport/ {print $3}' /etc/lincrc`
if ! /bin/ping -c 1 -w 3 $servaddr &>/dev/null ; then
[ -x /usr/bin/logger ] && logger $"linc server not responding to ping"
exit 1
fi
# Path to the linc script
linc=/usr/bin/linc
prog=linc
RETVAL=0
punch_firewall() {
if ! ipchains -L input -n | grep -q "$servaddr.*$servport" ; then
ipchains -I input -s $servaddr/32 $servport -d 0/0 -p udp -j
ACCEPT
[ -x /usr/bin/logger ] && logger $"punching linc server
$servaddr:
$servport through the firewall"
fi
}
start() {
echo -n $"Starting $prog: "
punch_firewall
daemon $linc
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/linc
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc $prog -INT
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/linc /var/run/linc.pid
}
login() {
if [ -e /var/lock/subsys/linc ]; then
echo -n $"Logging in $prog: "
killproc $prog -USR1
RETVAL=$?
echo
else
start
fi
}
logout() {
if [ -e /var/lock/subsys/linc ]; then
echo -n $"Logging out $prog: "
killproc $prog -USR2
RETVAL=$?
echo
fi
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $linc
RETVAL=$?
;;
restart)
stop
start
;;
logout)
logout
;;
login)
login
;;
*)
echo $"Usage: $prog {start|stop|restart|status|help|login|logout}"
exit 1
esac
exit $RETVAL
--
Dinesh A. Joshi
--
http://mm.ilug-bom.org.in/mailman/listinfo/linuxers