More work on switching pypo to use setuptools, added lxc-bootstrap script for ease of testing across distros
This commit is contained in:
parent
4749ef111c
commit
6bc3a1cfba
3 changed files with 84 additions and 11 deletions
59
installer/lxc-bootstrap
Executable file
59
installer/lxc-bootstrap
Executable file
|
@ -0,0 +1,59 @@
|
|||
#!/bin/bash -e
|
||||
#-e Causes bash script to exit if any of the installers
|
||||
#return with a non-zero return value.
|
||||
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
echo "Please run as root user."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dist=$1
|
||||
release=$2
|
||||
name=airtime-install
|
||||
|
||||
set +e
|
||||
echo -e "\n * Stopping ${name}..."
|
||||
lxc-stop -n airtime-install
|
||||
echo "...Done"
|
||||
|
||||
echo -e "\n * Destroying ${name}..."
|
||||
lxc-destroy -n airtime-install
|
||||
echo "...Done"
|
||||
set -e
|
||||
|
||||
echo -e "\n * Creating ${name} with dist ${dist} and release ${release}..."
|
||||
lxc-create -t download -n ${name} -- --dist ${dist} --release ${release} --arch amd64
|
||||
echo "...Done"
|
||||
|
||||
echo -e "\n * Starting ${name}..."
|
||||
lxc-start -n ${name} -d
|
||||
echo "...Done"
|
||||
|
||||
echo -e "\n * Running apt update..."
|
||||
lxc-attach -n ${name} -e -- apt-get update
|
||||
echo "...Done"
|
||||
|
||||
echo -e "\n * Installing git..."
|
||||
lxc-attach -n ${name} -e -- apt-get -y --force-yes install git
|
||||
echo "...Done"
|
||||
|
||||
echo -e "\n * Cloning Airtime..."
|
||||
lxc-attach -n ${name} -- git clone https://github.com/sourcefabric/Airtime.git /usr/share/Airtime
|
||||
echo "...Done"
|
||||
|
||||
echo -e "\n * Checking out installer branch..."
|
||||
lxc-attach -n ${name} -- git -C /usr/share/Airtime checkout 2.5.x-installer-monitless
|
||||
echo "...Done"
|
||||
|
||||
echo -e "\n * Running installer..."
|
||||
lxc-attach -n ${name} -e -- /usr/share/Airtime/installer/install -ifapdIv
|
||||
echo "...Done"
|
||||
|
||||
IP=$(lxc-info -i -n ${name} -H)
|
||||
echo -e "\n * Opening ${name} in your browser..."
|
||||
if hash xdg-open 2>/dev/null; then
|
||||
xdg-open "http://${IP}/"
|
||||
elif hash gnome-open 2>/dev/null; then
|
||||
gnome-open "http://${IP}/"
|
||||
fi
|
||||
echo "...Done"
|
Loading…
Add table
Add a link
Reference in a new issue