forked from Influencer/UNplugged
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanetwait.plg
More file actions
35 lines (29 loc) · 972 Bytes
/
anetwait.plg
File metadata and controls
35 lines (29 loc) · 972 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?xml version='1.0' standalone='yes'?>
<PLUGIN>
This plug-in is used to work around an issue where your network does not come up
before plug-ins are installed, leading to "BAD DOWNLOADS".
The plug-in simply runs a while loop until internet access is detected. Once
access has been detected, the plug-in exits the loop and the rest of your plug-ins
continue to install.
In order for this plug-in to work, it MUST be the alphabetical first plug-in.
All credit for this plug-in goes to Lime-tech Forum user sensine.
<!-- wait for Internet access -->
<FILE Name="/tmp/tomsinetwait" Run="/bin/bash">
<INLINE>
<![CDATA[
#!/bin/sh
COUNT=0
while [ $COUNT -lt 10 ]; do
x=`ping -c1 google.com 2>&1 | grep -i unknown`
if [ ! "$x" = "" ]; then
echo "Waiting for Internet access"
sleep 10
fi
let COUNT=COUNT+1
done
rm /tmp/tomsinetwait
echo "Anetwait.plg is done, internet access detected!"
]]>
</INLINE>
</FILE>
</PLUGIN>