Merge "Export die() function"
This commit is contained in:
commit
13323c9495
@ -7,7 +7,6 @@ fi
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
source $_LIB/die
|
||||
[ -n "$TMP_HOOKS_PATH" ] || die "Temp hook path not set"
|
||||
|
||||
echo "$DIB_ENV" > $TMP_HOOKS_PATH/dib_environment
|
||||
|
@ -8,7 +8,6 @@ fi
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
source $_LIB/die
|
||||
[ -n "$TMP_HOOKS_PATH" ] || die "Temp hook path not set"
|
||||
|
||||
if [ -e ~/.ssh/authorized_keys ]; then
|
||||
|
@ -9,7 +9,6 @@ set -eu
|
||||
set -o pipefail
|
||||
|
||||
# sanity checks
|
||||
source $_LIB/die
|
||||
[ -n "$IMAGE_BLOCK_DEVICE" ] || die "Image block device not set"
|
||||
|
||||
# execute sfdisk with the given partitioning schema
|
||||
|
@ -8,7 +8,6 @@ fi
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
source $_LIB/die
|
||||
[ -n "$IMAGE_BLOCK_DEVICE" ] || die "Image block device not set"
|
||||
|
||||
# Create 2 partitions for PPC, one for PReP boot and other for root
|
||||
|
9
lib/die
9
lib/die
@ -1,13 +1,13 @@
|
||||
#!/bin/bash
|
||||
# Copyright 2012 Hewlett-Packard Development Company, L.P.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
@ -16,10 +16,11 @@
|
||||
|
||||
# Prints "message" and exits
|
||||
# Usage: die "message"
|
||||
function die() {
|
||||
function die {
|
||||
local exitcode=$?
|
||||
set +o xtrace
|
||||
echo $@
|
||||
exit $exitcode
|
||||
}
|
||||
|
||||
export -f die
|
||||
|
Loading…
Reference in New Issue
Block a user