SpectreOS-old/update-packages

46 lines
948 B
Text
Raw Normal View History

2018-08-22 00:33:30 +02:00
#!/bin/bash
set -ex
2018-08-22 00:39:11 +02:00
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"
2018-08-22 00:46:12 +02:00
hostname="$(cat /etc/hostname)"
[[ -z "${version}" ]] && version="${hostname#*-}"
2018-08-22 01:18:50 +02:00
WEBADDRESS="ssh://git@5.83.162.84:22/home/git/SpectreOS"
WEBADDRESS1="ssh://git@5.83.162.84:22/home/git/shell-scripte"
2018-08-22 00:33:30 +02:00
repo=SpectreOS
repo1=shell-scripte
2018-08-22 01:18:50 +02:00
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 /
2018-08-22 00:33:30 +02:00
function standartinstallation() {
pacman -Syu $(cat /opt/${repo}/packages_${version}.txt) --needed --noconfirm --ignore linux
}
standartinstallation
echo "Fertig!!!"