generated from alice-meta-packages/alice-meta-template
add ldap-hostname script and service
Deploy Package / Explore-Gitea-Actions (push) Successful in 14s
Deploy Package / Explore-Gitea-Actions (push) Successful in 14s
This commit is contained in:
1 parent
60f506b2c7
commit
0a77bc0003
2 files changed
+21
No files matched your search
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
IP=$(hostname -I | awk '{print $1}')
|
||||
HOSTNAME=$(getent hosts | grep $IP | awk '{print $2}')
|
||||
|
||||
if [ -n "$HOSTNAME" ]; then
|
||||
hostnamectl set-hostname "$HOSTNAME"
|
||||
echo "Hostname set to $HOSTNAME"
|
||||
else
|
||||
echo "Hostname not found for IP $IP"
|
||||
fi
|
||||
Reference in new issue
Block a user