Download a shell script that automatically restarts Google's official/cm Android source code

Source: Internet
Author: User

Domestic for some reason, download cm or Google official Android source code is always easy to break. Always looking at the machine, it's too cumbersome to re-execute repo sync as soon as I interrupt, so I wrote a shell script (download.sh) deliberately. Decide whether to execute the Repo Sync command again by getting the status code that the shell returned last.

#!/bin/BashEcho "======start Repo sync======"RepoSync# download Android source code for the first time while[ $? !=0]; Do  Echo "======sync failed, Re-sync again======"  Sleep 2RepoSync# If it goes wrong, call repo sync again after 2 seconds to download Android source code Done

Where "$?" You can get the state of the shell's most recent execution, and if it succeeds, returns 0, otherwise it returns a number other than 0. Copy the script (download.sh) to the root directory of the Android source code and execute the script. It doesn't matter if it's interrupted.

Download a shell script that automatically restarts Google's official/cm Android source code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.