bootstrap script + apt-sources
[inetstation.git] / bootstrap.sh
1 #!/bin/bash -x
2
3 GITPROJ=https://chaos.expert/ccc-ffm/4Refugees-InternetCafe
4
5
6 if [ "$1" != "RUNME" ]; then
7
8     #pull myself from git repo
9     wget "${GITPROJ}/raw/master/bootstrap.sh" -O /root/bootstrap.sh
10     chmod u+x /root/bootstrap.sh
11     exec /root/bootstrap.sh RUNME
12     exit
13 fi
14
15 #check for install.hqs
16 if ping -c 5 instal.hq; then
17     echo 'Acquire::http::Proxy "http://install.hq:8080/";' > /etc/apt/apt.conf
18 else
19     echo "#no proxy" > /etc/apt/apt.conf
20 fi
21
22 apt update
23 apt install git puppet vim
24 apt full-upgrade
25
26
27 if [ ! -e /etc/puppet/.git ]; then  
28     mv /etc/puppet /etc/puppet.orig
29     git clone ${GITPROJ}.git /etc/puppet
30 fi
31
32
33 cd /etc/puppet
34 git pull
35 git submodule init
36 git submodule update
37 git pull
38 puppet apply /etc/puppet/manifests/site.pp