Change the sequence number of yor service so it is called before the wifi service.

man update-rc.d


How do I run a script (that needs WIFI) on shutdown before WIFI is down
From "The Cat Who Walks Through Walls" Wiki article:


  During a meeting of the Council of the Time Scouts, representatives from every major time line and setting written by Heinlein appear, including Glory Road and Starship Troopers; and a reference is made to other authors' works as well.


Who was the representative from Starship Troopers?
