#!/bin/bash
URL="https://linux.gurn.at"
PKGS="curl screen sudo vim zsh"

if [[ "`whoami`" != "root" ]]
then
	echo "Must be run as root"
	exit 1
fi

DISTR="`grep 'ID_LIKE' /etc/os-release`"

if [ ! -z "`echo ${DISTR} | grep debian`" ]
then
	apt install -y ${PKGS}
elif [ ! -z "`echo ${DISTR} | grep rhel`" ]
then
	yum install -y ${PKGS} deltarpm
elif [ ! -z "`grep 'ID=alpine' /etc/os-release`" ]
then
	apk add ${PKGS}
fi


for file in motd zshrc
do
	curl "${URL}/${file}" -o "/etc/${file}"
done
