Home Forums Software InstaDMG postflight unable to modify file

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #382476
    88gb525dxQK4gt6u
    Participant

    I am installing the Type to Learn 4 application onto the image using instaDMG. It installs correctly in /Applications/Sunburst/Type To Learn 4/

    This part of the postflight script I got it to work fine
    #!/bin/bash
    mkdir -p "$3/Library/Application Support/Sunburst/Type to Learn 4"
    mv "$2/development.sqlite3" "$3/Library/Application Support/Sunburst/Type to Learn 4/"
    #open "$2"

    The problem comes because I need to modify the ‘/Applications/Sunburst/Type To Learn 4/Settings.ini’ to point to our server.

    Here is what I tried so far in the postflight script
    #Overwriting file line by line
    echo "database=webservice" > '$3/Applications/Sunburst/Type to Learn 4/Settings.ini'
    echo "serverUrl=http://myserver:myport" >> '$3/Applications/Sunburst/Type to Learn 4/Settings.ini'
    echo "version_major=1" >> '$3/Applications/Sunburst/Type to Learn 4/Settings.ini'
    echo "version_minor=1" >> '$3/Applications/Sunburst/Type to Learn 4/Settings.ini'

    #overwriting the whole file
    cp "$0/Settings.to.copy.ini" '$3/Applications/Sunburst/Type to Learn 4/Settings.ini'

    Even this delete does not work!
    #deleting the file?
    rm '$3/Applications/Sunburst/Type to Learn 4/Settings.ini'

    What seems strange to me is that even running this on the terminal does not work either
    $ sudo echo "database=webservice" > /Applications/Sunburst/Settings.ini
    -bash: /Applications/Sunburst/Settings.ini: Permission denied

    PS: tried with chown to root:admin and chmod 755

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

Comments are closed