container-provisioner/provision.sh
2024-12-17 00:53:44 -05:00

30 lines
640 B
Bash
Executable File

#!/bin/bash
# usage ./provision.sh
if [ "$USER" != "root" ]; then
echo "must be run as root"
exit 2
fi
FLAVOR=$1
BASEPATH=$2
if [ ! -d "$BASEPATH" ]; then
debootstrap $FLAVOR "$BASEPATH"
fi
if [ ! -d "$BASEPATH" ]; then
echo "base path not found: $BASEPATH"
exit 2
fi
# update the sources.list - this is only for ubuntu!!
echo "deb http://archive.ubuntu.com/ubuntu $FLAVOR main universe
deb http://archive.ubuntu.com/ubuntu $FLAVOR-updates main universe
deb http://archive.ubuntu.com/ubuntu $FLAVOR-backports main universe
deb http://archive.ubuntu.com/ubuntu $FLAVOR-security main universe" > $BASEPATH/etc/apt/sources.list