Guest User

Untitled

a guest
Jun 20th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #!/bin/bash -e
  2.  
  3.  
  4. usage="USAGE: $0 action [marsnat version]
  5. ACTIONS:
  6. start - starts the docker instance [takes optional masnat version]
  7. stop - stops the docker instance
  8. restart - restarts the docker instance [takes optional marsnat version]
  9. bash - puts you in the docker environment's bash prompt
  10. "
  11.  
  12. ACTION=""
  13. VERSION=""
  14.  
  15. while getopts "hs" flag; do
  16. case $flag in
  17. h)
  18. echo "$usage"
  19. exit 0
  20. ;;
  21. s)
  22. SILENT=1
  23. ;;
  24. esac
  25. done
  26.  
  27. echo "$OPTIND"
  28.  
  29. for (( x=1; x<$OPTIND; x++ )); do shift "$((OPTIND-1))"; done
  30.  
  31. ACTION="$1"
  32. VERSION="$2"
  33.  
  34. if [ "$ACTION" == "" ]; then
  35. echo "$usage"
  36. exit 1
  37. fi
  38.  
  39. echo "action: $ACTION .... version: $VERSION"
Add Comment
Please, Sign In to add comment