# Hamachi Login Problem!



## vzsu (Dec 4, 2009)

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


----------



## earthsaver (Dec 4, 2009)

I'm pretty sure Hamachi servers have been offline for the last week. However, a PC seems to be getting on them just fine. All of the Macs on which I use Hamachi have been unable to log in, though.


----------



## vzsu (Dec 4, 2009)

But is it just now that the Macs cant log in or generally? i mean... when i try to log in manually it normally works. maybe not on the first try but sooner or later it does. thats why i would like the script to retry on login failure


----------

