2018-02-26 02:41:29 +01:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# sudo update standart username userpass
|
|
|
|
#
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
echo "Version : Fr 22. Dez 00:00:41 CET 2017"
|
|
|
|
|
2018-07-05 15:45:24 +02:00
|
|
|
WEBADDRESS="ssh://git@5.83.162.84:22/home/git/SpectreOS"
|
2018-02-26 02:41:29 +01:00
|
|
|
repo="SpectreOS"
|
|
|
|
user="user1"
|
2018-04-08 20:04:07 +02:00
|
|
|
hostname="$(cat /etc/hostname)"
|
2018-04-20 23:03:47 +02:00
|
|
|
version="${1}"
|
|
|
|
[[ -z "${version}" ]] && version="${hostname#*-}"
|
2018-02-26 02:41:29 +01:00
|
|
|
|
|
|
|
if [[ $EUID -ne 0 ]]; then
|
|
|
|
echo "This script must be run as root" 1>&2
|
2018-03-28 07:33:47 +02:00
|
|
|
sudo $0 $1 $2 $3 $4 $5 $6 $7 $8 $9
|
2018-02-26 02:41:29 +01:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
echo "Als root Angemeldet"
|
|
|
|
|
|
|
|
function gitclone() {
|
2018-03-14 19:40:21 +01:00
|
|
|
if [ -d "/opt/${repo}" ]; then
|
2018-02-26 02:41:29 +01:00
|
|
|
echo "${repo} existiert bereits!!!"
|
2018-03-14 19:40:21 +01:00
|
|
|
cd /opt/${repo}
|
2018-08-13 15:02:34 +02:00
|
|
|
git reset --hard
|
2018-03-14 19:40:21 +01:00
|
|
|
git pull
|
|
|
|
else
|
|
|
|
git clone ${WEBADDRESS} /opt/${repo}
|
2018-02-26 02:41:29 +01:00
|
|
|
fi
|
|
|
|
cd /
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ "${1}" != "n" ]
|
|
|
|
then
|
|
|
|
read -p "Soll im Internet geguckt werden ob es neue Updates gibt?: [Y/n] " update
|
|
|
|
if [ "${update}" == "debug" ]
|
|
|
|
then
|
|
|
|
echo "Überspringe das herunterladen einen neuen Scriptes!!!"
|
|
|
|
else
|
|
|
|
if [ "${update}" != "n" ]
|
|
|
|
then
|
|
|
|
if [ -f /usr/bin/git ]; then
|
|
|
|
gitclone
|
|
|
|
else
|
|
|
|
echo "Git is not installet"
|
|
|
|
pacman -S git --needed --noconfirm
|
|
|
|
fi
|
2018-08-26 21:41:36 +02:00
|
|
|
/opt/${repo}/arch-graphical-install-auto "${version}" "${2}" "${3}"
|
2018-02-26 02:41:29 +01:00
|
|
|
read -p "Aktualisierung erfolgreich Abgeschlossen. Wollen sie den PC NEUSTARTEN?: [Y/n] " sicherheitsabfrage
|
|
|
|
if [ "$sicherheitsabfrage" != "n" ]
|
|
|
|
then
|
|
|
|
echo "starte neu"
|
|
|
|
reboot
|
|
|
|
fi
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|