← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~evilnick/maas/adding_script_usage into lp:maas

 

Nick Veitch has proposed merging lp:~evilnick/maas/adding_script_usage into lp:maas.

Requested reviews:
  MAAS Maintainers (maas-maintainers)

For more details, see:
https://code.launchpad.net/~evilnick/maas/adding_script_usage/+merge/121636

Just added some usage info to the maas-import-pxe-files script, as there wasn't any and it annoyed me. I promise it doesn't break anything. Probably.
-- 
https://code.launchpad.net/~evilnick/maas/adding_script_usage/+merge/121636
Your team MAAS Maintainers is requested to review the proposed merge of lp:~evilnick/maas/adding_script_usage into lp:maas.
=== modified file 'scripts/maas-import-pxe-files'
--- scripts/maas-import-pxe-files	2012-08-24 12:52:51 +0000
+++ scripts/maas-import-pxe-files	2012-08-28 15:03:33 +0000
@@ -42,6 +42,19 @@
 # Default is yes.
 IMPORT_EPHEMERALS=${IMPORT_EPHEMERALS:-1}
 
+# show script usage/summary 
+show_usage() { 
+    echo 
+    echo "Usage:  ${0##*/}"
+    echo "This helper script downloads the relevant boot images from ubuntu.com and uses"
+    echo "'maas' to provision them for PXE booting from tftp. "
+    echo "The script takes no arguments, but you can adjust some parameters by editing"
+    echo "the config file found at \033[1m$settings\033[0m."
+    echo 
+    echo "MAAS homepage:<http://maas.ubuntu.com>"
+    echo
+    exit
+}
 
 # Put together a full URL for where the installer files for architecture $1
 # and release $2 can be downloaded.
@@ -139,9 +152,19 @@
 
 
 main() {
+
     import_install_images
     import_ephemeral_images
 }
 
+# check for commandline arguments
+if [ $# -gt 0 ]
+  then
+   case $1 in
+    "-h"|"--help") show_usage ; exit ;;
+    *) show_usage ; exit ;;
+    esac
+fi
 
 main
+