#!/bin/bash set -e # # brutal network setup & ssh pubkeys # [[ -z $2 ]] && echo usage: $0 host-cidr gateway hostname && exit 1 cidr=$1 guest=$2 gw=$3 [[ ! -d lala/etc/rc.d/ ]] && echo lala/etc/rc.d/ not found && exit 1 [[ ! -d lala/root/ ]] && echo lala/root/ not found && exit 1 echo -n brutal network setup... [[ -f lala/etc/rc.d/rc.inet1 ]] && \ mv -i lala/etc/rc.d/rc.inet1 lala/etc/rc.d/rc.inet1.dist && \ chmod -x lala/etc/rc.d/rc.inet1.dist cat > lala/etc/rc.d/rc.inet1 < lala/etc/HOSTNAME && echo done mv -i lala/etc/hosts lala/etc/hosts.dist cat > lala/etc/hosts < lala/root/.ssh/authorized_keys && echo done chmod 700 lala/root/.ssh/ chmod 600 lala/root/.ssh/authorized_keys echo all done echo