Skip to content

Commit

Permalink
Update update_mad.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
krzee authored Dec 27, 2019
1 parent 70e7758 commit 5889ff6
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion update_mad.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ function update_init(){
echo
}

function update_dhcp(){
grep -q net.hostname /system/build.prop && unset UpdateDHCP && return 1
origin="$(awk -F'>' '/post_origin/{print $2}' /data/data/com.mad.pogodroid/shared_prefs/com.mad.pogodroid_preferences.xml|cut -d'<' -f1)"
if grep -q 'net.hostname' /system/build.prop ;then
sed -i -e "s/^net.hostname=.*/net.hostname=${origin}/g" /system/build.prop
else
echo "net.hostname=${origin}" >> /system/build.prop
fi

}

function print_help(){
echo "install:"
echo "su"
Expand All @@ -80,6 +91,7 @@ function print_help(){
echo " -r (Update RemoteGPSController)"
echo " -p (Update PokemonGO)"
echo " -d (Update PogoDroid)"
echo " -n (update name in DHCP)"
echo " -i (Update MAD ROM init script)"
echo " -a (Update all)"
echo " -c (ClearCache of PokemonGo)"
Expand All @@ -98,6 +110,9 @@ do
-d)
UpdatePogoDroid=1
;;
-n
UpdateDHCP=1
;;
-a)
UpdateRGC=1
UpdatePoGo=1
Expand All @@ -120,9 +135,10 @@ done
((($UpdateRGC)) || (($UpdatePogoDroid)) || (($UpdatePoGo))) && stop_mad
(($UpdateRGC)) && update_rgc
(($UpdatePogoDroid)) && update_pogodroid
(($UpdateDHCP)) && update_dhcp
(($UpdatePoGo)) && update_pokemon
(($ClearCache)) && echo "clearing cache of app pokemongo" && /system/bin/pm clear com.nianticlabs.pokemongo
(($UpdateInit)) && update_init
((($UpdateRGC)) || (($UpdateInit)) || (($UpdatePogoDroid)) || (($UpdatePoGo))) && reboot_device
((($UpdateRGC)) || (($UpdateInit)) || (($UpdateDHCP)) || (($UpdatePogoDroid)) || (($UpdatePoGo))) && reboot_device

exit

0 comments on commit 5889ff6

Please sign in to comment.