全部博文(62)
分类: BSD
2011-11-06 15:49:46
iMac:/Library root# cd /Library iMac:/Library root# ls -l --- Stuff Removed --- drwxr-xr-x 6 root wheel 204 Apr 6 13:22 StartupItems --- Stuff Removed --- iMac:/Library root# cd StartupItems iMac:/Library/StartupItems root# ls -l drwxr-xr-x 4 root wheel 136 Apr 6 12:50 AddRoutes iMac:/Library/StartupItems root# cd AddRoutes iMac:/Library/StartupItems/AddRoutes root# ls -l -rwxr-xr-x 1 root wheel 292 Apr 6 10:05 AddRoutes -rwxr-xr-x 1 root wheel 127 Apr 6 09:47 StartupParameters.plist 两个文件内容为: |
iMac:/Library/StartupItems/AddRoutes root# cat AddRoutes #!/bin/sh # Set up static routing tables # Roark Holz, Thursday, April 6, 2006 . /etc/rc.common StartService () { ConsoleMessage "Adding Static Routing Tables" route add -net 192.168.3.0/24 192.168.0.180 } StopService () { return 0 } RestartService () { return 0 } RunService "$1" iMac:/Library/StartupItems/AddRoutes root# cat StartupParameters.plist { Description = "Add static routing tables"; Provides = ("AddRoutes"); Requires = ("Network"); OrderPreference = "None"; } |