forked from marktonneson/demo-cockpit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cockpit-setup.sh
executable file
·50 lines (39 loc) · 1.19 KB
/
cockpit-setup.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
#!/bin/bash
TextReset='\033[0m'
TextGreen='\033[32m'
TextBlue='\033[34m'
TextLightGrey='\033[37m'
TextBold='\033[1m'
FormatTextPause="$TextReset $TextLightGrey" # Pause & continue
FormatTextCommands="$TextReset $TextGreen" # Commands to execute
FormatTextSyntax="$TextReset $TextBlue $TextBold" # Command Syntax & other text
# Place before command line to reset text format
FormatRunCommand="echo -e $TextReset"
echo -e $FormatTextSyntax "
Installing Cockpit via:
Note: For RHEL 8, cockpit package is installed by default.
# yum install cockpit
"
$FormatRunCommand
yum install -y cockpit
useradd cockpituser
# This is obviously a terrible security practice, never do this in real life!
echo "cockpit" | passwd --stdin cockpituser
usermod -a -G wheel cockpituser
echo -e $FormatTextSyntax "
Enable service and firewall
# systemctl enable cockpit.socket
# firewall-cmd --permanent --add-service=cockpit
# firewall-cmd --reload
# systemctl start cockpit
"
$FormatRunCommand
systemctl enable cockpit.socket
firewall-cmd --permanent --add-service=cockpit
firewall-cmd --reload
systemctl start cockpit
echo -e $FormatTextSyntax "
Now access via:
https://`uname -n`:9090
"
$FormatRunCommand