@@ -47,17 +47,13 @@ setup_ssh() {
47
47
;;
48
48
esac
49
49
50
- # Enable and start the appropriate SSH service
51
- " $ESCALATION_TOOL " systemctl enable " $SSH_SERVICE "
52
- " $ESCALATION_TOOL " systemctl start " $SSH_SERVICE "
50
+ startAndEnableService " $SSH_SERVICE "
53
51
54
- # Get the local IP address
55
52
LOCAL_IP=$( ip -4 addr show | awk ' /inet / {print $2}' | tail -n 1)
56
53
57
54
printf " %b\n" " ${GREEN} Your local IP address is: $LOCAL_IP ${RC} "
58
55
59
- # Check if SSH is running
60
- if systemctl is-active --quiet " $SSH_SERVICE " ; then
56
+ if isServiceActive " $SSH_SERVICE " ; then
61
57
printf " %b\n" " ${GREEN} SSH is up and running.${RC} "
62
58
else
63
59
printf " %b\n" " ${RED} Failed to start SSH.${RC} "
@@ -137,12 +133,11 @@ setup_samba() {
137
133
EOL
138
134
fi
139
135
140
- # Enable and start Samba services
141
- " $ESCALATION_TOOL " systemctl enable smb nmb
142
- " $ESCALATION_TOOL " systemctl start smb nmb
136
+ for service in smb nmb ; do
137
+ startAndEnableService " $service "
138
+ done
143
139
144
- # Check if Samba is running
145
- if systemctl is-active --quiet smb && systemctl is-active --quiet nmb; then
140
+ if isServiceActive smb && isServiceActive nmb; then
146
141
printf " %b\n" " ${GREEN} Samba is up and running.${RC} "
147
142
printf " %b\n" " ${YELLOW} Samba share available at: $SHARED_DIR ${RC} "
148
143
else
0 commit comments