Merge ~jocave/plainbox-provider-checkbox:add-check-static into plainbox-provider-checkbox:master

Proposed by Jonathan Cave
Status: Merged
Approved by: Jonathan Cave
Approved revision: 70931cb246037be34723a6de424bf91f3ddf7214
Merged at revision: d546e8a546b28471b8897aa889ea611e55943c7a
Proposed branch: ~jocave/plainbox-provider-checkbox:add-check-static
Merge into: plainbox-provider-checkbox:master
Diff against target: 34 lines (+28/-0)
1 file modified
bin/check_static (+28/-0)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+357622@code.launchpad.net

Description of the change

Import the check_static script to go with the test that is now in this provider

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

+1, we could revisit merging the two providers if we continue migrating jobs and scripts to p-p-c

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/bin/check_static b/bin/check_static
0new file mode 1007550new file mode 100755
index 0000000..dc649d5
--- /dev/null
+++ b/bin/check_static
@@ -0,0 +1,28 @@
1#!/bin/bash
2
3IFACE="$1"
4
5if [ "$IFACE" = "" ]; then
6 echo "No interface specified"
7 exit 1
8fi
9
10CARRIER=$(nmcli -t --fields WIRED-PROPERTIES.CARRIER d show $IFACE | cut -d ":" -f 2)
11if [ "$CARRIER" = "off" ]; then
12 echo "No cable present"
13 exit 1
14fi
15
16CONN_NAME=$(nmcli -t --fields GENERAL.CONNECTION d show $IFACE | cut -d ":" -f 2)
17if [ "$CONN_NAME" = "--" ]; then
18 echo "No connection active on $IFACE"
19 exit 1
20fi
21echo "Connection active on $IFACE is $CONN_NAME"
22
23CONN_METHOD=$(nmcli -t --fields ipv4.method c show "$CONN_NAME" | cut -d ":" -f 2)
24if [ "$CONN_METHOD" = "auto" ]; then
25 echo "FAIL: $CONN_METHOD"
26 exit 1
27fi
28echo "PASS: $CONN_METHOD"

Subscribers

People subscribed via source and target branches