Need script to run on first boot then remove itself

I am working on panther and tiger images to deploy in labs at middle schools. There is a piece of software that the district owns that is network aware and each computer on a network running this software needs its own individual station number set in a config file. I have written a script that will set this number to be the last 3 digits of the static ip address of the computer and i can run this from ard on multiple computers but i would like to somehow include this script in the image so it is run the first time the computer boots up after being cloned and then does not run again. We also use virex on these computers and when we clone with virex installed we are having problems updating the defs. I would like to also be able to have a folder with the virex package file in it and on first bootup after the clone have a script run and install virex on the first boot.
I am sure this is not too difficult but I have not done anything like this before, maybe a couple oneliners to get me started, Thanks.
Do not want to use post action items in netrestore.
Mark

You may want to post your question in the Unix discussions:
http://discussions.apple.com/forum.jspa?forumID=735

Similar Messages

  • Need script to run command line as administrator

    I need a VB Script to run a certain command line "wmic Product where name='XXX XXX XXX' call uninstall" in an elevated command prompt.
    This is to uninstall a hidden application.
    Is this possible? It must be I have see many others with suggestions and here it is. I tried a few I have seen but have not been able to get any to work.

    Bill,
    Thank you for the quick answer. I believe you are right in your assumption.
    I have been searching but found nothing so far.
    I need to be able to run this line "wmic
    Product where name='XXX XXX XXX' call uninstall" 
    in an elevated command prompt to uninstall the program.
    I was looking for a VB script or PowerShell to execute it remotely on non domain roaming PCs.
    Th3e command can be run remotely against stand-alone workstations but you must supply credentials.  Post in the platform forum for you version of Windows for help in using the WMIC utility.  WMIC /? will give you all of the command options fro
    remote execution.  UAC only affects local systems.  You cannot use WMIC to remote back to the local system. WMIC does not allow impersonation to the local system.
    Most installers will not automatically allow an unattended uninstall.  If there is any dialog at all the uninstall will fail and can hang.
    I recommend contacting the vendor of the application to get more information.
    In all cases you cannot bypass UAC as Bill has noted.  I am only noting that, sometimes, in a workgroup, you can use WMIC to remotely uninstall an application.
    ¯\_(ツ)_/¯

  • Need help to run  The First EJB program

    hello i m new to the ejb
    i tried to run the very simple exaple i was able to compile the following code and deploy them to the j2ee server but i wavs un able to run the cilent program in the same machine
    here are the codes
    // this is remote intterface class
    public interface remote extends javax.ejb.EJBObject{
    public String show() throws java.rmi.RemoteException;
    //home interface
    import javax.ejb.*;
    import java.rmi.*;
    public interface homeinter extends EJBHome{
    remote create()throws CreateException,RemoteException;
    //bean
    import javax.ejb.SessionBean;
    import javax.ejb.EJBException;
    import java.rmi.RemoteException;
    import javax.ejb.SessionContext;
    public class bean implements SessionBean {
    SessionContext sct;
    public String show() throws RemoteException {
    return " this is from bean";
    public void ejbActivate(){}
    public void ejbPassivate(){}
    public void ejbCreate(){}
    public void ejbRemove(){}
    public void setSessionContext(SessionContext set){
    this.sct=set;
    // client
    import javax.ejb.*;
    import javax.rmi.*;
    import javax.naming.*;
    import java.rmi.*;
    public class client {
    public static void main(String[] args) {
    try{
    InitialContext ic= new InitialContext();
    Object obj= ic.lookup("MySecond");
    homeinter h=(homeinter)PortableRemoteObject.narrow(obj,homeinter.class);
    remote r=h.create();
    System.out.println("the return value is" + r.show());
    }catch(Exception e){
    e.printStackTrace();
    in the DOS prompt i tried to run the programme like
    set CPATH=.;c:\j2ee\lib\j2ee.jar;secondClient.jar
    java -Dorg.omg.CORBA.ORBInitialHost=lacalhost -classpath %CPATH% client
    then i had the following error mesage
    C:\ejb>set CPATH=.;c:\j2ee\lib\j2ee.jar;secondClient.jar
    C:\ejb>java -Dorg.omg.CORBA.ORBInitialHost=Localhost -classpath .;c:\j2ee\lib\
    j2ee.jar;secondClient.jar client
    Exception in thread "main" java.lang.NoSuchMethodError: loadClass0
    at com.sun.corba.ee.internal.util.JDKClassLoader.specialLoadClass(Native
    Method)
    at com.sun.corba.ee.internal.util.JDKClassLoader.loadClass(JDKClassLoade
    r.java:58)
    at com.sun.corba.ee.internal.util.JDKBridge.loadClassM(JDKBridge.java:18
    0)
    at com.sun.corba.ee.internal.util.JDKBridge.loadClass(JDKBridge.java:83)
    at com.sun.corba.ee.internal.javax.rmi.CORBA.Util.loadClass(Util.java:37
    8)
    at javax.rmi.CORBA.Util.loadClass(Unknown Source)
    at javax.rmi.PortableRemoteObject.createDelegateIfSpecified(Unknown Sour
    ce)
    at javax.rmi.PortableRemoteObject.<clinit>(Unknown Source)
    at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.jav
    a:57)
    at com.sun.enterprise.naming.SerialContext.<init>(SerialContext.java:79)
    at com.sun.enterprise.naming.SerialInitContextFactory.getInitialContext(
    SerialInitContextFactory.java:54)
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.init(Unknown Source)
    at javax.naming.InitialContext.<init>(Unknown Source)
    at client.main(client.java:10)
    pls give me a solution
    thank you

    1. which app server u r using ? R u using RI ?
    2. what is this secondclient.jar ?
    3. Have u added server specific jar containing implementation of IntialConrtextFactory in the classpath of client?
    4. If using RI, then I suppose u will have to set "Support Client Choice" (Possibly) to true, then generate client.jar.
    5. Which IDE u r using (If any) ?
    6. Are u sure that ur jar file (containng EJBs) deployed successfully ?
    7. Almost every server provides GUI console sort of , u can check whether it was deployed successfuly ?
    Pls update
    GiveMeJ
    Sanjeev

  • I have a MacBook Air (Intel Core 2 Duo) Mac OS X 10.6.8, I would like to update to Lion, but I am not sure if I have the latest version of SNOW LEOPARD v10.6.8, do I need to update to Leopard first and then to Lion or could I just update to Lion?

    I have a MacBook Air (Intel Core 2 Duo) Mac OS X 10.6.8, I would like to update to Lion but I am not sure if I need the Snow Leopard, I am not sure if I have it, or if I can just download the Lion. Please help.

    Select About This Mac from the Apple menu. The dialog will display the installed version.

  • ImacG3 boots then shuts itself down-HELP Pls

    Hi all,
    This is my first post so I'll just let y'all know that I've searched for a few days to try to find the answer myself but to no avail .... I've been Sys Support for Mac networks for 20 years and am now working freelance at home. Here is my problem ...
    1)-- I have an imac G3 333Mhz OS9.2 that was booting fully but had black screen so I rebooted and zapped PRAM; after I did this now the imac boots, green key lights on monitor, then it whirs, then green light lights on caps lock on keyboard, then it shuts itself off. Hmmm, any suggestions. Previous to this, I started an OSJaguar install but it hung up so I was forced to pull the plug. It would boot from OSX CD but now won't boot from any boot CD.

    No need to deactivate to reinstall on the same machine, but you might want to use the cleaner tool (CS Cleaner Tool for installation problems | CCM, CS6, CS5.5, CS5, CS4, CS3)

  • New user - Opening a file on first login, then removing from startup items

    I'm trying to write a script to open a pdf welcoming a new user on an imaged mac. I've written the script "Welcome.app" below
    tell application "Preview"
    open "OS X Tiger:Users:Shared:Welcome.pdf"
    end tell
    do shell script "rm /Users/Shared/Welcome.app"
    I'm having problems with permissions this way. I've tried changing the user and group but no luck so far.
    It was suggested to me to try using "defaults write loginwindow etc" to
    remove the Welcome.app from the startup items, but I'm not sure if this is possible from the terminal.
    Any suggestions?
    Netrestore generic image   Mac OS X (10.4.6)  

    Create a second copy of the loginwindow.plist file in the User Template's Preferences folder with the name loginwindow.original.plist, and use the following two commands after the tell block:
    do shell script "mv ~/Library/Preferences/loginwindow.plist ~/.Trash/loginwindow.plist"
    do shell script "mv ~/Library/Preferences/loginwindow.original.plist ~/Library/Preferences/loginwindow.plist"
    The script will then disappear from the startup items, but will remain on the hard disk.
    (12565)

  • First boot of local zone - how to determine when sysidtool has finished

    Hello,
    we use a /etc/sysidcfg in order to do the solaris base configuration automatically. After the first boot of a local zone I recognized that some tools are started by solaris (sysidtool, etc.) which apply the settings mentioned in /etc/sysconfig.
    Since we want to script some post-install set-ups I need to know, when the first boot including all "first-boot-scripts" has completely finished. Is it possible to query this information, maybe by calliing a special tool or by looking up some string within an logfile?
    I would be grateful for any hints,
    Thomas

    I haven't checked, but I assume they have normal dependencies in the SMF tree so that other services don't start until they complete.
    I would probably look at the milestone/multi-user-server service and see if it's online yet. If it is, they're probably done.
    Darren

  • What is a neat way to delete a stale amavisd pid_file on first boot after panic or power failure?

    Lion Mail Server component postfix/smtp 100% reproducible blocks inbound smtp mail delivery on first boot after a panic or power failure.
    Error messages from mail.log are like:
    postfix/smtp[45785]: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused postfix/smtp[45785]: 2F7131F9A97: to=<[email protected]>, relay=none, delay=76041, delays=76040/0.36/0.05/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]:10024: Connection refused) postfix/error[45790]: 550D61F9A99: to=<[email protected]>, relay=none, delay=76040, delays=76040/0.39/0/0, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused) postfix/postscreen[45872]: NOQUEUE: reject: RCPT from [100.200.100.159]:65392: 450 4.3.2 Service currently unavailable; from=<[email protected]>, to=<[email protected]>, proto=ESMTP, helo=<host.domain.tld> /usr/libexec/postfix/greylist.pl[45885]: Temporary message rejection to: <[email protected]> from: <[email protected]> sent from: [100.200.100.159] for: 60 seconds due to greylisting postfix/smtpd[45879]: NOQUEUE: reject: RCPT from host.domain.tld[100.200.100.159]: 450 4.7.1 <[email protected]>: Recipient address rejected: Service is unavailable; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<host.domain.tld>
    The issue seems to be related to the amavis content filter due to the connection to port number 10024 and amavisd being configured on that port. Amavis.log:
    /usr/bin/amavisd[236]: (!)Net::Server: 2012/07/25-13:38:49 Pid_file already exists for running process (88)... aborting\n\n  at line 277 in file /System/Library/Perl/Extras/5.12/Net/Server.pm ... /usr/bin/amavisd[236]: Net::Server: 2012/07/25-13:38:49 Server closing! ...repeating roughly every 10 seconds...
    The workaround is to reboot the machine, after the second boot the inbound smtp mail delivery is no longer stuck.
    The issue seems to be related to http://serverfault.com/questions/138690/amavisd-net-server-pid-file-already-exis ts-after-system-crash-and-startup
    How to permanently fix Apple Mail Server to accept smtp inbound messages on first boot, by removing the left over amavis pid_file from the previous unclean shutdown?

    Use connection pooling. This will put the connection management in the hands of the webserver, not your code. Check out this post:
    http://forum.java.sun.com/thread.jspa?threadID=741788&messageID=4252932#4252932

  • I need help writing a script that finds the first instance of a paragraph style and then changes it

    I need help writing a script that finds the first instance of a paragraph style and then changes it to another paragraph style.  I don't necessarily need someone to write the whole thing, by biggest problem is figuring how to find just the first instance of the paragraph style.  Any help would be greatly appreciated, thanks!

    Hi,
    Do you mean first instance of the paragraph style
    - in a chosen story;
    - on some chosen page in every text frames, looking from its top to the bottom;
    - in a entire document, looking from its beginning to the end, including hidden layers, master pages, footnotes etc...?
    If story...
    You could set app.findTextPreferences.appliedParagraphStyle to your "Style".
    Story.findText() gives an array of matches. 1st array's element is a 1st occurence.
    so:
    Story.findText()[0].appliedParagraphStyle = Style_1;
    //==> this will change a paraStyle of 1st occurence of story to "Style_1".
    If other cases...
    You would need to be more accurate.
    rgds

  • Running unix scripts on first boot after imaging

    Hi,
    I have a setup in which student users at the school I work for log in via AD to create a mobile account on the local system. This all works great in snow leopard so far, the issue i am having is I have a couple of bash scripts that run at boot. They run ok, but one script opens up the folder the script is located in (script does run, and the folder doesn't open the next time a student logs in), and I also have a Acceptable Use Policy PDF the opens up on log in, the first time a user logs into a system, it opens in Safari, the second time it opens it is in Preview (I want it to open in preview each time).
    These problems aren't exactly show stoppers, but they are pretty annoying (especially since students log in to 5 or 6 different computers per day, so the errors show up 5 or 6 time per day for the users.)
    Any suggestions to get this fixed would be greatly appreciated!

    osascript -e 'tell application "Preview"' -e 'open file "path:to:file.pdf"' -e 'end tell'

  • Jumpstart , smf and scripts on first boot

    Could anyone help me I am trying to work out how which is the best way to apply patches and customizations on first boot of a new machine that has just been jumpstarted. Does anyone have a example of a service that runs once to allow me to do this?

    I want to be able to not just add patches I need to
    add packages make system changes I used to be able to
    do this with /etc/rc2.d scripts but now its smf in
    solaris 10 and I need to be able to make this changes
    at run level 2 and then reboot.You can do it just like before. Put a script in /etc/rc2.d.
    You can also create a SMF manifest, and a custom "site" profile to activate/deactivate the services you want. Put them into the manifest and profile directories and they'll be loaded and activated/deactivated at first boot.
    Darren

  • I am running Leopard OS X 10.5.8.  I want to upgrade to Lion.  Do I need to download Snow Leopard first?

    I am running Leopard OS X 10.5.8.  I want to upgrade to Lion.  Do I need to download Snoe Leopard first? 
    Thanks

    I cannot make that determination for you. Snow Leopard is not available as a download. You have to purchase it at an Apple Store or order it online. Snow Leopard 10.6.6 or later is required to purchase and download Lion from the App Store. Total cost would be $59.00 exclusive of tax and shipping (if any.)
    Sometime this month Apple plans to make available a USB flash drive containing the full standalone Lion installe for $69.00. If you did not want Snow Leopard then you may want to wait for this to be available.

  • HI i am user for InDesincc TrialVersion now. i have serious question for all guys in here. at first i installed Indesigncc as korean language but now i need to indesigncc english language installation. and then now i cant translate and changing korean lan

    Daniel SterchiHI i am user for InDesincc TrialVersion now. i have serious question for all guys in here. at first i installed Indesigncc as korean language but now i need to indesigncc english language installation. and then now i cant translate and changing korean language interface to english language interface at indesigncc download. so i wonder How i can do that?...i am very seriuos for now....i want indesigncc version for Eng.Language interface. but now i cant do that .i dont konw how i can presented kor. interfacing transite to eng. interface..
    forumnotifierHI i am user for InDesincc TrialVersion now. i have serious question for all guys in here. at first i installed Indesigncc as korean language but now i need to indesigncc english language installation. and then now i cant translate and changing korean language interface to english language interface at indesigncc download. so i wonder How i can do that?...i am very seriuos for now....i want indesigncc version for Eng.Language interface. but now i cant do that .i dont konw how i can presented kor. interfacing transite to eng. interface..

    First of all, uninstall it with the uninstaller.
    Then:
    Install the ENGLISH version.
    Change the language in the CC app to Korean.
    Install the Korean version. (DON't uninstall the English version)
    Change back the langauge in the CC app to English.
    When your OS is running in English, InDesign will run in English with Korean functionality added, if your OS is running in Korean it will take the Korean User Interface, so let your OS run in English.
    Every installer language will add needed plugins for the work with that language. E.g. If I install Hebrew, I get RTL functionality in German version, only if I would change the OS language it would change the language of InDesign, InDesign takes always as UI language the language of the OS if available, if not (in your case you have uninstalled English before), it takes any version which is available in the order of languages specified in the OS.
    If you need to run your program in a different language than the OS but you have installed it in the language of the OS it becomes more difficult. You would have to use some system tools which are able to force a program to open with a different language. Most of those tools are freeware.

  • I would like to run the vi first and then press the safe button to write it to disk.i am sending you the vi. please can you tell me how can i correct this vi?

    i am running some vis in frames of sequence frome frame number 1 to frame 10.after this i would like to create one other vi with some strings and i want to save it to disk with a save button. i am opening,writing and closing the data.what i want is that a save button to write the file .moreover i would like to run the application first and then press the safe button to write it to disk.i am sending you the vi. please can you tell me how can i correct this vi?
    Attachments:
    savestrings.vi ‏80 KB

    Here's a picture of a while loop around part of your code. All it's doing is waiting to write until the user presses the save button. If you need it to do more, explain in more detail.
    Attachments:
    While_Loop.jpg ‏17 KB

  • Upgrade and Install fails after first boot. Then I am unable to repair

    I don't know if anyone else has experienced this?
    I've experienced the aqua screen of death with the Upgrade option and was unable to resolve it, even after trying the APE removing technique.
    So, I decided to restore back to Tiger 10.4.10 (thanks to Super Dupering prior to upgrade) and try the archive and install option. All appeared to go well, installed fine, allowed me to login and run all my apps. But, upon doing my first reboot after the 'sucessful' install the system just hangs at the gray screen. I tried using Disk Utility from the Leopard DVD, but it's unable to repair permissions.
    I got this error message: 'The underlying task reported failure on exit'. Tried many times, I also tried the /sbin/fsck -fy in single user mode.
    I tried booting into DiskWarrior 4's. Once in DW4 I ran the Repair function there... Here I got another error message.
    This error being: 'Error -9997'.
    OK I thought, something random must have happened. Soooo I restored to Tiger again and ran the Archive and Install option once again.
    I'm am again experiencing the exact same problems with freezing gray boot screen and the inability to repair permissions (all after doing my first boot after sucessful install and login/opening of many apps)
    Please please please can anyone she some light on this problem???
    I'm going to try one more option:
    Upgrade after I've disable all startup options and removing anything to do with APE....
    I will report back!
    This is really really crap Apple, I can't believe I've spent £85 and probably 15 hours on this sloppy release. Utterly disapointed

    Just me it seems then....
    Right, I think it's finally resolved, only after the fifth time. I've now rebooted twice and so far so good.
    There was a new message when I powered down for the first time, something along the lines of:
    Please wait while your Boot Caches are updated.
    This seems to be a reasuring message, I feel almost confident in restarting again.
    I upgraded using the following method:
    1. Disabled ALL startup items (System Preferences>Accounts>Login items)
    2. Removed all traces of APE (Application Enhancer) using Finder:
    /Library/Preference Panes/Application Enhancer.prefpane
    /Library/Frameworks/Application Enhancer.framework
    /System/Library/SystemConfiguration/Application Enhancer.bundle
    /Library/Preferences/com.unsanity.ape.plist
    3. Repaired Permissions
    Right, before I perform a new backup I think I'll see how she runs for a week, so I'm sure the boot problem is definitely gone.

Maybe you are looking for

  • XML message as input for webservice gives deserialization error

    Hi, jDeveloper 10.1.3 BPEL PM 10.1.2.0.2 Carrental example Problem: For the Business Rule Engine I did the Carrental XML example. Based on the java application that connects to the BR engine, I created a webservice in jDeveloper and deployed it to my

  • Errors Message while issuing the material in MB1A i.e unrestricted material

    Hi Expert, I want know the Message while issuing the material in MB1A we are getting the error unrestricted material, so what is the reason of error.(i.e there is no stock available or any other give me the reply as soon as possible) Regards, Ram Rat

  • Floppy  Drive - 3 1/2

    Is it possible to get a Floppy Drive that reads 3 1/2 floppies for the Intel Mac? The reason I ask is I have quite a few graphic floppies that I would like to use if I can. If I there is one, would the Intel be able to read them or would I have probl

  • Problem connecting to Lotus Directory from Java.

    I am very new to LDAP and I have a problem. I am writing java code to connect to lotus directory and I am getting an exception. Following is the code : package jndibridge; * @author RKSUR import javax.naming.*; import java.util.Hashtable; import java

  • Com.sap.pcuigp.xssfpm.java.FPMRuntimeException: No Adobe Form Is Assigned

    Hi Portal Experts, We are using Interactive Adobe Forms for an ISR Scenario running on  EP7.0 NW04s, SAP R/3--ECC6.0 It is working fine from longtime but suddenly i dont know why it is not working now.throwing an FPM Runtime Exception, Recently our R