0c752781e8
$GRENADE_DIR/functions pulls in devstack functions, and needs $GRENADE_DIR/grenaderc to be sourced first. Do this for all affected scripts. stop-base also needs the grenade.settings file as that handles all the partial services. reorder clean.sh to remove warnings Change-Id: I5baa17783abe0c235691d88e484331c7960549f9
60 lines
1.5 KiB
Bash
Executable File
60 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# ``save-state``
|
|
|
|
echo "*********************************************************************"
|
|
echo "Begin $0"
|
|
echo "*********************************************************************"
|
|
|
|
set -o errexit
|
|
|
|
# Clean up any resources that may be in use
|
|
cleanup() {
|
|
set +o errexit
|
|
|
|
echo "*********************************************************************"
|
|
echo "ERROR: Abort $0"
|
|
echo "*********************************************************************"
|
|
|
|
# Kill ourselves to signal any calling process
|
|
trap 2; kill -2 $$
|
|
}
|
|
|
|
# Keep track of the grenade directory
|
|
GRENADE_DIR=$(cd $(dirname "$0") && pwd)
|
|
|
|
# Source params
|
|
source $GRENADE_DIR/grenaderc
|
|
|
|
# Import common functions
|
|
source $GRENADE_DIR/functions
|
|
|
|
# Determine what system we are running on. This provides ``os_VENDOR``,
|
|
# ``os_RELEASE``, ``os_UPDATE``, ``os_PACKAGE``, ``os_CODENAME``
|
|
# and ``DISTRO``
|
|
GetDistro
|
|
|
|
|
|
# For debugging
|
|
set -o xtrace
|
|
|
|
|
|
# Save databases
|
|
# --------------
|
|
|
|
save_data $BASE_RELEASE $BASE_DEVSTACK_DIR
|
|
|
|
# Save ebtables/iptables
|
|
# ----------------------
|
|
|
|
sudo iptables-save >$SAVE_DIR/iptables.$BASE_RELEASE
|
|
sudo ebtables -t broute -L >$SAVE_DIR/ebtables-broute.$BASE_RELEASE
|
|
sudo ebtables -t filter -L >$SAVE_DIR/ebtables-filter.$BASE_RELEASE
|
|
sudo ebtables -t nat -L >$SAVE_DIR/ebtables-nat.$BASE_RELEASE
|
|
|
|
|
|
set +o xtrace
|
|
echo "*********************************************************************"
|
|
echo "SUCCESS: End $0"
|
|
echo "*********************************************************************"
|