Merge ~morphis/snappy-hwe-snaps/+git/wifi-ap:check-interface-is-available into ~snappy-hwe-team/snappy-hwe-snaps/+git/wifi-ap:master

Proposed by Simon Fels
Status: Merged
Approved by: Simon Fels
Approved revision: 1313865cf8b3176f00b5ccb46128e3796a882fd8
Merged at revision: 2762d4b4df7a2c392b050cab7ca92e16b365b0b6
Proposed branch: ~morphis/snappy-hwe-snaps/+git/wifi-ap:check-interface-is-available
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/wifi-ap:master
Diff against target: 24 lines (+8/-1)
1 file modified
bin/ap.sh (+8/-1)
Reviewer Review Type Date Requested Status
Matteo Croce (community) Approve
Konrad Zapałowicz (community) Approve
Review via email: mp+305090@code.launchpad.net

Description of the change

Before we start using a WiFi network interface check if it is present and fail if that is not the case.

To post a comment you must log in.
Revision history for this message
Matteo Croce (teknoraver) :
Revision history for this message
Konrad Zapałowicz (kzapalowicz) wrote :

Ack

review: Approve
Revision history for this message
Matteo Croce (teknoraver) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/bin/ap.sh b/bin/ap.sh
index 66aa782..f017554 100755
--- a/bin/ap.sh
+++ b/bin/ap.sh
@@ -26,11 +26,18 @@ fi
2626
27DEFAULT_ACCESS_POINT_INTERFACE="ap0"27DEFAULT_ACCESS_POINT_INTERFACE="ap0"
2828
29if [ "$DISABLED" == "1" ] ; then29if [ $DISABLED -eq 1 ] ; then
30 echo "Not starting as WiFi AP is disabled"30 echo "Not starting as WiFi AP is disabled"
31 exit 031 exit 0
32fi32fi
3333
34# Make sure the configured WiFi interface is really available before
35# doing anything.
36if ! ifconfig $WIFI_INTERFACE ; then
37 echo "ERROR: WiFi interface $WIFI_INTERFACE is not available!"
38 exit 1
39fi
40
34shutdown() {41shutdown() {
35 DNSMASQ_PID=$(cat $SNAP_DATA/dnsmasq.pid)42 DNSMASQ_PID=$(cat $SNAP_DATA/dnsmasq.pid)
36 kill -TERM $DNSMASQ_PID43 kill -TERM $DNSMASQ_PID

Subscribers

People subscribed via source and target branches

to all changes: