]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/network-suspend-scripts/files/ifupdown
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / network-suspend-scripts / files / ifupdown
1 #!/bin/sh
2 # Unloads/loads all interface that are up at time of suspend
3
4 if [ "$1" = suspend ]; then
5         rm -f /var/run/ifstate-suspend
6         rm -f /var/run/ifstate-old
7         cp /var/run/ifstate /var/run/ifstate-old
8         cat /var/run/ifstate-old | (
9         IFS="="
10         while read IFACE LOGICAL; do
11                 ifdown $IFACE
12                 echo "$IFACE=$LOGICAL" >>/var/run/ifstate-suspend
13         done
14         rm -f /var/run/ifstate-old
15         )
16 elif [ "$1" = resume ] && [ "$2" != standby ] && [ -f /var/run/ifstate-suspend ]; then
17         cat /var/run/ifstate-suspend | (
18         while read LINE; do
19                 ifup $LINE
20         done
21         )
22         rm -f /var/run/ifstate-suspend
23 fi
24
25 : exit 0
26