summaryrefslogtreecommitdiff
path: root/share/hydractl/provision
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2015-09-26 11:11:48 -0300
committerSilvio Rhatto <rhatto@riseup.net>2015-09-26 11:11:48 -0300
commit52ecfc3590fc33bff702ec1478ac61378639c849 (patch)
tree0718a796369176fee284e74c2415531174b55971 /share/hydractl/provision
parentf5ddf7507d440bf3642777d159a0a60ff55d0c5b (diff)
downloadhydra-52ecfc3590fc33bff702ec1478ac61378639c849.tar.gz
hydra-52ecfc3590fc33bff702ec1478ac61378639c849.tar.bz2
Provision: raspberry pi script
Diffstat (limited to 'share/hydractl/provision')
-rwxr-xr-xshare/hydractl/provision39
1 files changed, 5 insertions, 34 deletions
diff --git a/share/hydractl/provision b/share/hydractl/provision
index f214e0f..79c88cc 100755
--- a/share/hydractl/provision
+++ b/share/hydractl/provision
@@ -111,31 +111,8 @@ function hydra_provision_config {
hydra_user_config mirror http://http.debian.net/debian/ "Debian mirror"
}
-# Setup.
-if [ ! -z "$1" ]; then
- if [ -f "$1" ]; then
- echo "Using configuration from file $1..."
- source "$1"
- elif [ -f "$1.conf" ]; then
- echo "Using configuration from file $1.conf..."
- source "$1.conf"
- elif [ -f "$HYDRA_FOLDER/config/provision/$1" ]; then
- echo "Using configuration from $HYDRA_FOLDER/config/provision/$1..."
- source "$HYDRA_FOLDER/config/provision/$1"
- elif [ -f "$HYDRA_FOLDER/config/provision/$1.conf" ]; then
- echo "Using configuration from $HYDRA_FOLDER/config/provision/$1.conf..."
- source "$HYDRA_FOLDER/config/provision/$1.conf"
- elif [ -f "$APP_BASE/share/config/provision/$1" ]; then
- echo "Using configuration from $APP_BASE/share/config/provision/$1..."
- source "$APP_BASE/share/config/provision/$1"
- elif [ -f "$APP_BASE/share/config/provision/$1.conf" ]; then
- echo "Using configuration from $APP_BASE/share/config/provision/$1.conf..."
- source "$APP_BASE/share/config/provision/$1.conf"
- else
- echo "Profile not found: $1"
- exit 1
- fi
-fi
+# Load configuration
+hydra_provision_load_config
# Parameters
WORK="/tmp/debootstrap"
@@ -434,12 +411,7 @@ echo "Installing basic utilities..."
hydra_sudo_run chroot $WORK apt-get install screen cron lsb-release openssl -y
# Networking.
-echo "Doing a basic network config..."
-cat <<-EOF | $SUDO tee $WORK/etc/network/interfaces > /dev/null
-auto eth0
-allow-hotplug eth0
-iface eth0 inet dhcp
-EOF
+hydra_provision_networking
# Ssh.
echo "Installing OpenSSH daemon..."
@@ -452,9 +424,8 @@ hydra_sudo_run chroot $WORK apt-get install sudo -y
echo "Choose a root password."
hydra_sudo_run chroot $WORK passwd root
-echo "OpenSSH fingerprints:"
-hydra_sudo_run chroot $WORK ssh-keygen -l -f /etc/ssh/ssh_host_dsa_key.pub
-hydra_sudo_run chroot $WORK ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub
+# Fingerprints
+hydra_provision_fingerprints
cat <<-EOF