-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path01_configure_tlwebaccess.sh
More file actions
39 lines (35 loc) · 1.11 KB
/
01_configure_tlwebaccess.sh
File metadata and controls
39 lines (35 loc) · 1.11 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
#!/bin/bash
# Fetch thinlinc web access parameters
enable_web=$(jetpack config thinlinc.enable_web False)
thinlinc_web_port=$(jetpack config thinlinc.web_port 443)
# Function to restart tlwebaccess service
restart_tlwebaccess() {
if ! systemctl restart tlwebaccess; then
echo "Failed to restart tlwebaccess service."
exit 1
fi
echo "Thinlinc tlwebaccess service restarted successfully."
}
# Function to disable tlwebaccess service
disable_tlwebaccess() {
if ! systemctl disable --now tlwebaccess; then
echo "Failed to disable tlwebaccess service."
exit 1
fi
echo "Thinlinc tlwebaccess service disable successfully."
}
if [[ "$enable_web" == "True" ]]; then
# Update the listen_port
/opt/thinlinc/bin/tl-config /webaccess/listen_port=$thinlinc_web_port
if [[ $? -ne 0 ]]; then
echo "Failed to configure Thinlinc Web Access port number."
exit 1
fi
# Restart the tlwebaccess service to apply changes
restart_tlwebaccess
echo "Thinlinc Web Access port number configurations completed."
else
# Disable the tlwebaccess service
disable_tlwebaccess
echo "Disable Thinlinc Web access completed."
fi