Wednesday, January 6, 2010

changing Hostid in Linux

#include
#include

int main(int argc, char *argv[])
{
if(argc < 2)
{
fprintf(stderr,"Single argument: Target hostid\n",argv[0]);
return 1;
}
sethostid(
strtoul(argv[1],NULL,16) );
return 0;
}

1) Save this file as hostid_changer.c
2) gcc hostid_changer.c hostid_changer.out
3) ./hostid_changer.out (new_hostid for your system)

Cheers...


Regards
Sandeep

No comments:

Post a Comment

Secret of Universe

  Secret our universe... 10 Directions, 26 dimensions 18 Directions, No Dimension can exist 36 Dimensions, no direction can exist.. I dont h...