File tree 1 file changed +10
-8
lines changed
1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -14,18 +14,20 @@ get_fqdn() {
14
14
# Extract the domain using awk
15
15
domain=$( grep " ^Domains=" /etc/systemd/resolved.conf | awk -F= ' {print $2}' )
16
16
fi
17
- fi
18
17
19
- # Construct the FQDN
20
- if [ -n " $domain " ]; then
21
- fqdn=" ${hostname} .${domain} "
18
+ # Construct the FQDN
19
+ if [ -n " $domain " ]; then
20
+ fqdn=" ${hostname} .${domain} "
21
+ else
22
+ fqdn=" $hostname " # Default to just the hostname if no domain is set
23
+ fi
24
+
25
+ # Convert to lowercase (as you did with tr 'A-Z' 'a-z')
26
+ fqdn=$( echo " $fqdn " | tr ' A-Z' ' a-z' )
22
27
else
23
- fqdn=" $ hostname" # Default to just the hostname if no domain is set
28
+ fqdn=$( /usr/bin/ hostname " $@ " )
24
29
fi
25
30
26
- # Convert to lowercase (as you did with tr 'A-Z' 'a-z')
27
- fqdn=$( echo " $fqdn " | tr ' A-Z' ' a-z' )
28
-
29
31
echo " $fqdn "
30
32
}
31
33
You can’t perform that action at this time.
0 commit comments