Change APPLIANCE_BASE_DIR to more generic /tmp/akanda-appliance and only

setup ssh key if $APPLIANCE_SCRIPT_DIR/etc/key exists
This commit is contained in:
Jordan Tardif 2014-08-05 14:10:53 -04:00
parent aceaa891c1
commit 8ee7cd49fa
1 changed files with 8 additions and 11 deletions

View File

@ -2,7 +2,7 @@ TZ=UTC # Time zones are in /usr/share/zoneinfo
export DEBIAN_FRONTEND=noninteractive
APT_GET="apt-get -y"
APPLIANCE_BASE_DIR="/vagrant/akanda-appliance"
APPLIANCE_BASE_DIR="/tmp/akanda-appliance"
APPLIANCE_SCRIPT_DIR="$APPLIANCE_BASE_DIR/scripts"
PACKAGES="ntp python2.7 wget dnsmasq bird6"
PACKAGES_BUILD="python-dev python-pip isc-dhcp-client build-essential"
@ -98,11 +98,13 @@ rm -f /root/{.history,.viminfo}
rm -f /home/*/{.history,.viminfo}
rm -f /etc/ssh/*key*
echo "[*] Adding ssh key..."
mkdir /root/.ssh
chmod 700 /root/.ssh
cp $APPLIANCE_SCRIPT_DIR/etc/key /root/.ssh/authorized_keys
chmod 600 /root/.ssh/authorized_keys
if [ -e $APPLIANCE_SCRIPT_DIR/etc/key ]; then
echo "[*] Adding ssh key..."
mkdir /root/.ssh
chmod 700 /root/.ssh
cp $APPLIANCE_SCRIPT_DIR/etc/key /root/.ssh/authorized_keys
chmod 600 /root/.ssh/authorized_keys
fi
echo "[*] Setting root password"
if [ -e $APPLIANCE_SCRIPT_DIR/etc/rootpass ]; then
@ -133,14 +135,9 @@ ln -s /usr/share/zoneinfo/$TZ /etc/localtime
echo "[*] Use bash instead of dash"
rm /bin/sh ; ln -s /bin/bash /bin/sh
echo "[*] Clean up udev rules..."
rm -f /etc/udev/rules.d/70-persistent-net.rules
echo "[*] Remove vagrant specifics"
userdel -f vagrant
rm -rf /vagrant /home/vagrant
echo "[*] Enjoy Akanda!"
date
echo "[*] Done."