-
-
Save SaFi2266/534e7e89aa21106ed67186538fc93f1a to your computer and use it in GitHub Desktop.
Revisions
-
rragundez created this gist
Jun 21, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ #!/bin/bash set -e usage="$(basename "$0") [-h] [-i PROJECT] [-v VM] [-p PYTHON] [-d NOTEBOOKS] Make a user provide SSH key and jupyter notebooks (in roles/bootstrap/files/notebooks) to each user listed in var/common.yml where: -h show this help text -i google cloud project id -v name of instance/virtual machine -p python path -d if want to copy a notebooks directory" # constants PYTHON=/usr/bin/python3 NOTEBOOK_DIR=false options=':hi:v:p:d:' while getopts $options option; do case "$option" in h) echo "$usage"; exit;; i) PROJECT=$OPTARG;; v) VM=$OPTARG;; p) PYTHON=$OPTARG;; d) NOTEBOOK_DIR=$OPTARG;; :) printf "missing argument for -%s\n" "$OPTARG" >&2; echo "$usage" >&2; exit 1;; \?) printf "illegal option: -%s\n" "$OPTARG" >&2; echo "$usage" >&2; exit 1;; esac done # mandatory arguments if [ ! "$PROJECT" ] || [ ! "$VM" ]; then echo "arguments -i and -v must be provided" echo "$usage" >&2; exit 1 fi