sonic-buildimage/files/build_templates/organization_extensions.sh
ravijo2 458093fee5 Framework to plugin Organization specific scripts during ONIE Image build (#951)
* Framework to plugin Organization specific scripts

* Framework to plugin Organization specific scripts

* Framework to plugin Organization specific scripts

* add getopt option to organization script
2017-09-19 16:23:31 -07:00

53 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
#########################################################################
## This script is to automate Orignaization specific extensions #
## such as Configuration & Scripts for features like AAA, ZTP, etc. #
## to include in ONIE installer image #
## #
## USAGE: #
## ./organization_extensions.sh -f<filesystem_root> -n<hostname> #
## ./organization_extensions.sh \ #
## --fsroot <filesystem_root> \ #
## --hostname <hostname> #
## PARAMETERS: #
## -f FILESYSTEM_ROOT #
## The location of the root file system #
## -h HOSTNAME #
## The hostname of the target system #
#########################################################################
## Initialize the arguments to default values.
## The values get updated to user provided value, if supplied
FILESYSTEM_ROOT=./fsroot
HOSTNAME=sonic
# read the options
TEMP=`getopt -o f:h: --long fsroot:,hostname: -- "$@"`
eval set -- "$TEMP"
# extract options and their arguments into variables.
while true ; do
case "$1" in
-f|--fsroot)
case "$2" in
"") shift 2 ;;
*) FILESYSTEM_ROOT=$2 ; shift 2 ;;
esac ;;
-h|--hostname)
case "$2" in
"") shift 2 ;;
*) HOSTNAME=$2 ; shift 2 ;;
esac ;;
--) shift ; break ;;
*) echo "Internal error!" ; exit 1 ;;
esac
done
echo "Executing SONIC Organization Extensions"
## Place your Organization specific code / scipts here ...
echo "SONIC Organization Extensions - Done"