set hostname through network manager

This commit is contained in:
Adeeb Shihadeh
2022-09-23 11:53:57 -07:00
parent acedbed308
commit af1cf59a0a
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -1,5 +1,6 @@
[Unit]
Description=Sets the hostname to the device's serial number
After=NetworkManager.service
[Service]
User=root
+1 -1
View File
@@ -3,4 +3,4 @@ set -e
SERIAL="$(cat /proc/cmdline | sed -e 's/^.*androidboot.serialno=//' -e 's/ .*$//')"
echo "serial: '$SERIAL'"
hostname "tici-$SERIAL"
nmcli general hostname "tici-$SERIAL"