Hey guys,
i have a big problem with the hamachi service on my mac (with snow leopard)
i have a script running in StartupItems to make hamachi start automatically on boot/reboot. my problem is, that often it starts the hamachi service but does not log in. is there any way to edit the script so, if log in failes, it retries to log in automatically? or is there just an error you guys can see in that script which makes that sometimes the "login" command just doesnt work? i got it from a german website and maybe there is just something else wrong with it. the thing is, sometimes it works and the service starts AND it also logs in...
the script is:
#!/bin/sh
#
##
# Hamachi Autostarter for Mac OS
# Author: Christoph H. Hochstaetter, ZDNet.de
##
. /etc/rc.common
HAMACHI="/usr/bin/hamachi"
TUNCFG="/usr/sbin/tuncfg"
if [ `id -u` != 0 ]; then
ConsoleMessage "Must be root to use this script"
exit 5
fi
if [ ! -x $HAMACHI ]; then
ConsoleMessage "$HAMACHI does not exist"
exit 5
fi
if [ ! -x $TUNCFG ]; then
ConsoleMessage "$TUNCFG does not exist"
exit 5
fi
StartService ()
{
ConsoleMessage "Starting tuncfg .." $($TUNCFG && echo "ok")
$HAMACHI -c ~root/.hamachi start
$HAMACHI -c ~root/.hamachi login
$HAMACHI -c ~root/.hamachi get-nicks
}
StopService ()
{
$HAMACHI -c ~root/.hamachi stop
ConsoleMessage "Stopping tuncfg .." $(killall tuncfg && echo "ok")
}
RestartService ()
{
StopService;
StartService;
}
RunService "$1"
thanks for your help in advance
regards
i have a big problem with the hamachi service on my mac (with snow leopard)
i have a script running in StartupItems to make hamachi start automatically on boot/reboot. my problem is, that often it starts the hamachi service but does not log in. is there any way to edit the script so, if log in failes, it retries to log in automatically? or is there just an error you guys can see in that script which makes that sometimes the "login" command just doesnt work? i got it from a german website and maybe there is just something else wrong with it. the thing is, sometimes it works and the service starts AND it also logs in...
the script is:
#!/bin/sh
#
##
# Hamachi Autostarter for Mac OS
# Author: Christoph H. Hochstaetter, ZDNet.de
##
. /etc/rc.common
HAMACHI="/usr/bin/hamachi"
TUNCFG="/usr/sbin/tuncfg"
if [ `id -u` != 0 ]; then
ConsoleMessage "Must be root to use this script"
exit 5
fi
if [ ! -x $HAMACHI ]; then
ConsoleMessage "$HAMACHI does not exist"
exit 5
fi
if [ ! -x $TUNCFG ]; then
ConsoleMessage "$TUNCFG does not exist"
exit 5
fi
StartService ()
{
ConsoleMessage "Starting tuncfg .." $($TUNCFG && echo "ok")
$HAMACHI -c ~root/.hamachi start
$HAMACHI -c ~root/.hamachi login
$HAMACHI -c ~root/.hamachi get-nicks
}
StopService ()
{
$HAMACHI -c ~root/.hamachi stop
ConsoleMessage "Stopping tuncfg .." $(killall tuncfg && echo "ok")
}
RestartService ()
{
StopService;
StartService;
}
RunService "$1"
thanks for your help in advance
regards