#!/bin/bash set -ex if [[ $EUID -ne 0 ]]; then echo "This script must be run as root" 1>&2 sudo $0 $1 $2 $3 $4 $5 $6 $7 $8 $9 exit 0 fi echo "Als root Angemeldet" hostname="$(cat /etc/hostname)" [[ -z "${version}" ]] && version="${hostname#*-}" WEBADDRESS="ssh://git@5.83.162.84:22/home/git/SpectreOS" WEBADDRESS1="ssh://git@5.83.162.84:22/home/git/shell-scripte" repo=SpectreOS repo1=shell-scripte if [ -d "/opt/${repo}" ]; then echo "${repo} existiert bereits!!!" cd /opt/${repo} git reset --hard git pull else git clone ${WEBADDRESS} /opt/${repo} fi if [ -d "/opt/${repo1}" ]; then echo "${repo1} existiert bereits!!!" cd /opt/${repo1} git reset --hard git pull else git clone ${WEBADDRESS1} /opt/${repo1} fi cd / function standartinstallation() { pacman -Syu $(cat /opt/${repo}/packages_${version}.txt) --needed --noconfirm --ignore linux } standartinstallation echo "Fertig!!!"