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:
parent
aceaa891c1
commit
8ee7cd49fa
|
@ -2,7 +2,7 @@ TZ=UTC # Time zones are in /usr/share/zoneinfo
|
||||||
|
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
APT_GET="apt-get -y"
|
APT_GET="apt-get -y"
|
||||||
APPLIANCE_BASE_DIR="/vagrant/akanda-appliance"
|
APPLIANCE_BASE_DIR="/tmp/akanda-appliance"
|
||||||
APPLIANCE_SCRIPT_DIR="$APPLIANCE_BASE_DIR/scripts"
|
APPLIANCE_SCRIPT_DIR="$APPLIANCE_BASE_DIR/scripts"
|
||||||
PACKAGES="ntp python2.7 wget dnsmasq bird6"
|
PACKAGES="ntp python2.7 wget dnsmasq bird6"
|
||||||
PACKAGES_BUILD="python-dev python-pip isc-dhcp-client build-essential"
|
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 /home/*/{.history,.viminfo}
|
||||||
rm -f /etc/ssh/*key*
|
rm -f /etc/ssh/*key*
|
||||||
|
|
||||||
echo "[*] Adding ssh key..."
|
if [ -e $APPLIANCE_SCRIPT_DIR/etc/key ]; then
|
||||||
mkdir /root/.ssh
|
echo "[*] Adding ssh key..."
|
||||||
chmod 700 /root/.ssh
|
mkdir /root/.ssh
|
||||||
cp $APPLIANCE_SCRIPT_DIR/etc/key /root/.ssh/authorized_keys
|
chmod 700 /root/.ssh
|
||||||
chmod 600 /root/.ssh/authorized_keys
|
cp $APPLIANCE_SCRIPT_DIR/etc/key /root/.ssh/authorized_keys
|
||||||
|
chmod 600 /root/.ssh/authorized_keys
|
||||||
|
fi
|
||||||
|
|
||||||
echo "[*] Setting root password"
|
echo "[*] Setting root password"
|
||||||
if [ -e $APPLIANCE_SCRIPT_DIR/etc/rootpass ]; then
|
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"
|
echo "[*] Use bash instead of dash"
|
||||||
rm /bin/sh ; ln -s /bin/bash /bin/sh
|
rm /bin/sh ; ln -s /bin/bash /bin/sh
|
||||||
|
|
||||||
|
|
||||||
echo "[*] Clean up udev rules..."
|
echo "[*] Clean up udev rules..."
|
||||||
rm -f /etc/udev/rules.d/70-persistent-net.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!"
|
echo "[*] Enjoy Akanda!"
|
||||||
date
|
date
|
||||||
echo "[*] Done."
|
echo "[*] Done."
|
||||||
|
|
Loading…
Reference in New Issue