-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathraspberrypios-server-postinstall.sh
More file actions
executable file
·48 lines (39 loc) · 1.12 KB
/
raspberrypios-server-postinstall.sh
File metadata and controls
executable file
·48 lines (39 loc) · 1.12 KB
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
#!/usr/bin/env bash
# 0/1 : enable cockpit
cockpit=1
# 0/1 : Disable firewalld
disablefirewalld=0
# List of additional software to install
addsoftwares=(nmon htop vim tmux ncdu rsync)
# check root
if [[ $EUID -ne 0 ]]
then
sudo chmod +x "$(dirname "$0")/$0"
sudo "$(dirname "$0")/$0"
exit;
fi
# Update
apt update && apt upgrade -y
# Tools
if [[ -n ${addsoftwares[*]} ]]
then
apt install -y "${addsoftwares[@]}"
fi
type -p tmux >/dev/null && curl -JLO https://raw.githubusercontent.com/imomaliev/tmux-bash-completion/master/completions/tmux && mv tmux /usr/share/bash-completion/completions/tmux
# Cockpit
if [[ "$cockpit" -eq "1" ]]
then
apt install -y cockpit
apt install -y cockpit-networkmanager cockpit-dashboard cockpit-system cockpit-storaged cockpit-pcp cockpit-packagekit cockpit-docker
systemctl enable cockpit.socket
systemctl start cockpit.socket
#firewall-cmd --add-service=cockpit --permanent
#firewall-cmd --reload
fi
# Firewalld
if [[ "$disablefirewalld" -eq "1" ]]
then
systemctl stop firewalld
systemctl disable firewalld
fi
echo "Preparation completed, it is recommended to restart!"