From 6b7730aed073907a0cccf6ab3f37b1ee9df628b4 Mon Sep 17 00:00:00 2001 From: Chris R Date: Mon, 31 Jul 2023 22:58:29 +1200 Subject: [PATCH] Update hostname.sh Update hostname.sh to work with either Atlas or GC --- other/hostname.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/other/hostname.sh b/other/hostname.sh index 1db4fc0..dba1001 100644 --- a/other/hostname.sh +++ b/other/hostname.sh @@ -1,4 +1,9 @@ #!/system/bin/sh sleep 10 -deviceName=$(cat /data/local/tmp/atlas_config.json | tr , '\n' | grep -w 'deviceName' | awk -F ":" '{ print $2 }' | tr -d \"}) +if [[ -f /data/local/tmp/atlas_config.json ]] ;then + deviceName=$(cat /data/local/tmp/atlas_config.json | tr , '\n' | egrep -w 'deviceName' | awk -F ":" '{ print $2 }' | tr -d \"}) +elif [[ -f /data/local/tmp/config.json ]] ;then + deviceName=$(cat /data/local/tmp/config.json | tr , '\n' | egrep -w 'device_name' | awk -F ":" '{ print $2 }' | tr -d \"}) +else exit 0 +fi su -c setprop net.hostname $deviceName