SpectreOS/scripts/update.sh

49 lines
1.1 KiB
Bash
Raw Normal View History

2022-10-04 19:01:31 +02:00
#!/usr/bin/env bash
set -ex
user=$(whoami)
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
sudo "${0}" "$@"
exit 0
fi
echo "Als root Angemeldet"
version="${1}"
git config --global credential.helper store
repo=deadc0de-remix-os
repo1=shell-scripte-code
arch=$(uname -m)
# Aktualisiere die Repositiories
/opt/${repo}/repo.sh
if [ -d "/opt/${repo}" ]; then
echo "${repo} existiert bereits!!!"
cd /opt/${repo}
git checkout ${arch}
if ! git remote set-url origin ${WEBADDRESS_OS}; then
git remote add origin ${WEBADDRESS_OS}
fi
git pull
else
git clone -b ${arch} ${WEBADDRESS_OS} /opt/${repo}
fi
if [ -d "/opt/${repo1}" ]; then
echo "${repo1} existiert bereits!!!"
cd /opt/${repo1}
if ! git remote set-url origin ${WEBADDRESS_SCRIPTE}; then
git remote add origin ${WEBADDRESS_SCRIPTE}
fi
git pull
else
git clone ${WEBADDRESS_SCRIPTE} /opt/${repo1}
fi
cd /
/opt/${repo}/arch-graphical-install-auto.sh
echo "Fertig!!!"