Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Any one can help me do this with shell script:

  1. When VM startups, it checks if a folder (dbsync-installdir) exists
  2. if it does not exists, it will download the ZIP file using wget.
share|improve this question

migrated from stackoverflow.com Dec 13 '12 at 13:22

This question came from our site for professional and enthusiast programmers.

    
It would be interesting to know what you have tried. –  Benjamin Bannier Dec 13 '12 at 10:39

1 Answer 1

To check check if a directory doesn't exist:

if [ ! -d "$DIRECTORY" ]; then
    # Here if $DIRECTORY doesn't exist.
    wget http://url_to_zip_file
fi

To extract zip files see man unzip

Also you can check if a directory exists:

if [ -d "$DIRECTORY" ]; then
    # Here if $DIRECTORY exists.
fi
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.