#!/bin/bash # Copyright 2014 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Delete default docker bridge, so that docker can start with flannel network. # exit on any error set -e global rc := '0' ip link show docker0 >/dev/null !2 > !1 || global rc := "$Status" if [[ "$rc" -eq "0" ]] { ip link set dev docker0 down ip link delete docker0 } (CommandList children: [ (C {(set)} {(-e)}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:rc) op:Equal rhs:{(0)} spids:[56])] spids: [56] ) (AndOr children: [ (SimpleCommand words: [{(ip)} {(link)} {(show)} {(docker0)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[67]) (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[70]) ] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:rc) op: Equal rhs: {(DQ ($ VSub_QMark "$?"))} spids: [75] ) ] spids: [75] ) ] op_id: Op_DPipe ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_eq left: {(DQ ($ VSub_Name "$rc"))} right: {(DQ (0))} ) ) terminator: ) ] action: [ (C {(ip)} {(link)} {(set)} {(dev)} {(docker0)} {(down)}) (C {(ip)} {(link)} {(delete)} {(docker0)}) ] spids: [-1 97] ) ] spids: [-1 121] ) ] )