Allow mk-vmimage.sh to accept a configuration file as
an argument to '-c'. Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
c7959ee139
commit
437ed46f88
@ -188,9 +188,28 @@ vm_create_vmdisk() {
|
||||
}
|
||||
|
||||
main() {
|
||||
vm_config=
|
||||
while getopts "c:" arg; do
|
||||
case ${arg} in
|
||||
c)
|
||||
vm_config="${OPTARG}"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $(( ${OPTIND} - 1 ))
|
||||
|
||||
cmd="${1}"
|
||||
shift 1
|
||||
|
||||
if [ ! -z "${vm_config}" ]; then
|
||||
if [ ! -e "${vm_config}" ]; then
|
||||
panic "Configuration file ${vm_config} not found."
|
||||
fi
|
||||
. ${vm_config}
|
||||
fi
|
||||
|
||||
case ${cmd} in
|
||||
vm-base)
|
||||
eval vm_create_baseimage "$@" || return 0
|
||||
|
@ -188,9 +188,28 @@ vm_create_vmdisk() {
|
||||
}
|
||||
|
||||
main() {
|
||||
vm_config=
|
||||
while getopts "c:" arg; do
|
||||
case ${arg} in
|
||||
c)
|
||||
vm_config="${OPTARG}"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $(( ${OPTIND} - 1 ))
|
||||
|
||||
cmd="${1}"
|
||||
shift 1
|
||||
|
||||
if [ ! -z "${vm_config}" ]; then
|
||||
if [ ! -e "${vm_config}" ]; then
|
||||
panic "Configuration file ${vm_config} not found."
|
||||
fi
|
||||
. ${vm_config}
|
||||
fi
|
||||
|
||||
case ${cmd} in
|
||||
vm-base)
|
||||
eval vm_create_baseimage "$@" || return 0
|
||||
|
Loading…
Reference in New Issue
Block a user