autoexecutable

leinad256

Registered
Hi, I m looking info about a kind of autoexecutable. My problem is this. In my office we configured a proxie, but we need to run a script when we turn on the computer and log in to configure the internet correctly. It is a terminal script.

Code:
ifconfig en0 mtu 1492

we need run just this lines in the terminal window. Can u help me???


thanks
 
leinad256 said:
Hi, I m looking info about a kind of autoexecutable. My problem is this. In my office we configured a proxie, but we need to run a script when we turn on the computer and log in to configure the internet correctly. It is a terminal script.

Code:
ifconfig en0 mtu 1492

we need run just this lines in the terminal window. Can u help me???


thanks

u have to create a startup item, not too hard to realize.
u have to do all these steps logged as root.

- create a dir named mtu into /Library/StartupItems/
- create a new file named StartupParameters.plist into mtu folder
- write this code into the file:
Code:
{
  Description   = "mtu";
  Provides      = ("mtu");
  Requires      = ("Network");
  Uses          = ("Network");
  OrderPreference    = "Last";
}
- create a new file named mtu into mtu folder
- write this code into the file:
Code:
#!/bin/sh

. /etc/rc.common

StartService ()
{
	ConsoleMessage "Setting MTU"
	ifconfig en0 mtu 1492
}

RunService "$1"
- change this file to executable (chmod +x)
- restart your mac

;)
 
thanks very much!!! its working!!!

by the way, where can I find some info about that code?? and I wanna make a executable that put the files (like the mysql start up script that u found in the mysql package) I think I need the developer tools, is it correct?

thanks very much again!!!!
 
leinad256 said:
thanks very much!!! its working!!!

by the way, where can I find some info about that code?? and I wanna make a executable that put the files (like the mysql start up script that u found in the mysql package) I think I need the developer tools, is it correct?

thanks very much again!!!!

use packagemaker from xtools, u can extract it with pacifist without having to install all the tools. I've done in this way and all my startup items now have an installer. ;)
 
thanks very much

I gonna invite u some beers (well....if u come to Mexico, dont forget my invitation :D )

see ya
 
Back
Top