Skip to content
Snippets Groups Projects
bootstrap.sh 801 B
Newer Older
  • Learn to ignore specific revisions
  • wonko's avatar
    wonko committed
    #!/bin/bash -x
    
    wonko's avatar
    wonko committed
    
    GITPROJ=https://chaos.expert/ccc-ffm/4Refugees-InternetCafe
    
    
    
    wonko's avatar
    wonko committed
    if [ "$1" != "RUNME" ]; then
    
    wonko's avatar
    wonko committed
    
        #pull myself from git repo
        wget "${GITPROJ}/raw/master/bootstrap.sh" -O /root/bootstrap.sh
    
    wonko's avatar
    wonko committed
        chmod u+x /root/bootstrap.sh
    
    wonko's avatar
    wonko committed
        exec /root/bootstrap.sh RUNME
    
    wonko's avatar
    wonko committed
        exit
    
    wonko's avatar
    wonko committed
    #check for install.hqs
    if ping -c 5 instal.hq; then
        echo 'Acquire::http::Proxy "http://install.hq:8080/";' > /etc/apt/apt.conf
    else
        echo "#no proxy" > /etc/apt/apt.conf
    fi
    
    wonko's avatar
    wonko committed
    apt update
    apt install git puppet vim
    apt full-upgrade
    
    wonko's avatar
    wonko committed
    if [ ! -e /etc/puppet/.git ]; then  
        mv /etc/puppet /etc/puppet.orig
        git clone ${GITPROJ}.git /etc/puppet
    fi
    
    git remote set-url origin ${GITPROJ}.git
    
    wonko's avatar
    wonko committed
    git pull
    
    git submodule init
    git submodule update
    
    wonko's avatar
    wonko committed
    git pull
    
    puppet apply /etc/puppet/manifests/site.pp