Skip to content

Commit

Permalink
Add bash & bash completion
Browse files Browse the repository at this point in the history
  • Loading branch information
grossmj committed May 8, 2024
1 parent e9375f2 commit b8ce1ce
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
10 changes: 8 additions & 2 deletions docker/openvswitch/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
FROM alpine:latest

RUN apk add --update openvswitch nano && rm -rf /var/cache/apk/*
RUN apk add --no-cache --update openvswitch nano bash bash-completion

# Make bash the default shell
RUN sed -i s,/bin/ash,/bin/bash, /etc/passwd

# Enable bash completion
RUN echo -e "source /etc/profile.d/bash_completion.sh" >> ~/.bashrc

RUN mkdir /var/run/openvswitch

VOLUME /etc/openvswitch/

ADD boot.sh /bin/boot.sh

CMD /bin/sh /bin/boot.sh
CMD /bin/bash /bin/boot.sh
16 changes: 8 additions & 8 deletions docker/openvswitch/boot.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#!/bin/bash
#
# Copyright (C) 2015 GNS3 Technologies Inc.
# Copyright (C) 2024 GNS3 Technologies Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -16,7 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.


if [ ! -f "/etc/openvswitch/conf.db" ]
if [[ ! -f "/etc/openvswitch/conf.db" ]]
then
ovsdb-tool create /etc/openvswitch/conf.db /usr/share/openvswitch/vswitch.ovsschema

Expand All @@ -25,20 +25,20 @@ then
ovs-vsctl --no-wait init

x=0
until [ $x = "4" ]; do
until [[ $x = "4" ]]; do
ovs-vsctl add-br br$x
ovs-vsctl set bridge br$x datapath_type=netdev
x=$((x+1))
done

if [ $MANAGEMENT_INTERFACE == 1 ]
if [[ $MANAGEMENT_INTERFACE == 1 ]]
then
x=1
else
x=0
fi

until [ $x = "16" ]; do
until [[ $x = "16" ]]; do
ovs-vsctl add-port br0 eth$x
x=$((x+1))
done
Expand All @@ -49,9 +49,9 @@ fi


x=0
until [ $x = "4" ]; do
until [[ $x = "4" ]]; do
ip link set dev br$x up
x=$((x+1))
done

/bin/sh
/bin/bash

0 comments on commit b8ce1ce

Please sign in to comment.