training-guides/labs/scripts/osbash/init_xxx_node.sh
Roger Luethi 49541b99cb Adjust permissions
This changeset
- removes executable bits from README.md
- adds executable bits to shell scripts

These changes are largely symbolic, except for osbash.sh which users are
expected to run without having to change permissions or passing it as an
argument to bash.

Partial-Bug: 1312764
Implements: blueprint openstack-training-labs
Change-Id: I91cce85862171a360c31e1e7628a708dfefd70f1
2014-06-18 13:26:10 +02:00

31 lines
708 B
Bash
Executable File

#!/usr/bin/env bash
# This scripts configures hostname and networking for all nodes. The filename
# determines the node name.
TOP_DIR=$(cd $(dirname "$0")/.. && pwd)
source "$TOP_DIR/config/paths"
source "$CONFIG_DIR/credentials"
source "$LIB_DIR/functions.guest"
# Determine hostname from script name
re=".*init_(.*)_node.sh$"
if [[ $0 =~ $re ]]; then
NODE_NAME=${BASH_REMATCH[1]}
NODE_NAME="${NODE_NAME}"
else
echo "ERROR Unable to determine hostname"
exit 1
fi
indicate_current_auto
exec_logfile
# Set hostname for now and for rebooted system
sudo hostname "$NODE_NAME" >/dev/null
echo "$NODE_NAME" | sudo tee /etc/hostname > /dev/null
# Configure network interfaces
config_network