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