-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-on-fedora.sh
executable file
·133 lines (92 loc) · 3.49 KB
/
install-on-fedora.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!/bin/bash
SCRIPT="$(realpath $0)"
SCRIPTPATH="$(dirname $SCRIPT)"
cd "$SCRIPTPATH"
echo "Working in $SCRIPTPATH"
if [ "$EUID" != 0 ]
then
echo "The installer needs root privileges."
sudo $SCRIPT
exit
fi
## this should be fedora.
echo "Started the xoclock-installer."
source /etc/os-release
if [[ $NAME == "Fedora Linux" ]]
then
echo "Starting the installer"
else
echo "Your distribution is not supported yet. Please install manually."
exit
fi
mkdir -p /var/vlc
chmod 777 /var/vlc
dnf -y update
dnf -y install mc
## install vlc
dnf -y install --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
dnf -y install vlc
## aplay
dnf -y install alsa-utils
## sox with mp3 // libsox-fmt-mp3 on ubuntu
dnf -y install sox
#sox-plugins-freeworld
dnf -y install festival espeak
bash google-installer.sh
## dont deactivate if the lid is closed
echo "HandleLidSwitch=ignore" >> /etc/systemd/logind.conf
## open firewall and port setup
# dnf -y install iptables-services
echo "http and https will be opened on the firewall"
systemctl start firewalld
firewall-cmd --add-service=http
firewall-cmd --add-service=https
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reload
sudo dnf -y install nodejs
sudo dnf -y install xbindkeys
sudo dnf -y install jq
setcap 'cap_net_bind_service=+ep' /usr/bin/node
echo "" >> /etc/hosts
echo "127.0.0.1 xoclock" >> /etc/hosts
echo "" >> /etc/hosts
#node modules
npm install
npm rebuild
dnf -y install ntp
systemctl start ntpd
## reduce cpu and memory usage
systemctl stop abrtd
systemctl disable abrtd
## Create a certificate
ssl_password="no_password"
ssl_days=365
ssl_key=key.pem
ssl_csr=csr.pem
ssl_org=org.pem
ssl_crt=crt.pem
ssl_config=cert-config.txt
if [[ ! -f "$ssl_key" ]] || [[ ! -f "$ssl_crt" ]]
then
echo "Generate self-signed certificate"
## Generate a Private Key
openssl genrsa -des3 -passout "pass:$ssl_password" -out "$ssl_key" 2048 2> /dev/null
## Generate a CSR (Certificate Signing Request)
openssl req -new -passin "pass:$ssl_password" -passout "pass:$ssl_password" -key "$ssl_key" -out "$ssl_csr" -days "$ssl_days" -config "$ssl_config" 2> /dev/null
## Remove Passphrase from Key
cp "$ssl_key" "$ssl_org"
openssl rsa -passin "pass:$ssl_password" -in "$ssl_org" -out "$ssl_key" 2> /dev/null
## Self-Sign Certificate
openssl x509 -req -days "$ssl_days" -passin "pass:$ssl_password" -extensions v3_req -in "$ssl_csr" -signkey "$ssl_key" -out "$ssl_crt" 2> /dev/null
fi
## get music / we assume there is only one user
if [ -z "$(ls /home/*/Music)" ]
then
echo "We need Music"
cd /home/*/Music
wget ftp://d250.hu/D250/LaKing-Summer2006/LaKing-Summer2006.mp3
fi
echo "Installation done. Installation of google chrome is not part of the installer, please install manually."
echo "Based on the example configs, create settings.json and team's index.json in the xoclock application folder."
echo "You also might want to create the roundrobin schedule with make-groups.sh that will create groups.json"