-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetupFunctions.sh
34 lines (34 loc) · 987 Bytes
/
setupFunctions.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
#functions
# get-File FileName RepositoryName
get-File() {
if [ ! -e $1 ]
then
echo "$1 is missing"
wget https://raw.githubusercontent.com/heinz-otto/$2/master/$1
chmod +x $1
fi
}
setup-Fhem() {
# get debian version strings with dot sourcing
. /etc/os-release
if [ $VERSION_ID -ge 10 ] ;then
apt install gpg
if wget -qO - https://debian.fhem.de/archive.key | gpg --dearmor > /usr/share/keyrings/debianfhemde-archive-keyring.gpg ;then
echo "deb [signed-by=/usr/share/keyrings/debianfhemde-archive-keyring.gpg] https://debian.fhem.de/nightly/ /" >> /etc/apt/sources.list
key='ok'
fi
else
if [ "$(wget -qO - http://debian.fhem.de/archive.key | apt-key add -)" = "OK" ] ;then
echo "deb http://debian.fhem.de/nightly/ /" >> /etc/apt/sources.list
key='ok'
fi
fi
if [ $key = 'ok' ] ;then
apt update
apt install fhem
else
echo Es gab ein Problem mit dem debian.fhem.de/archive.key
exit 1
fi
}