Skip to content

Commit b12aae6

Browse files
committed
clone: fix pot.stack parameter
prepare: add -S option to specify the stack prepare: convert -S flag to -s (automatically start the pot when ready) clone: fix bridge parameter as well
1 parent 29f22d6 commit b12aae6

File tree

3 files changed

+27
-7
lines changed

3 files changed

+27
-7
lines changed

CHANGELOG.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Added
9+
- prepare: the -S option is now used to specify the network stack
10+
11+
### Changed
12+
- prepare: the -S flag to start the imported pot changed in -s
13+
814
### Fixed
9-
- fbsd-update: don't assume there is a tty
15+
- fbsd-update: don't assume there is a tty (#86)
16+
- clone: duplicate the entry pot.stack (#88)
1017

1118
## [0.11.1] 2020-04-19
1219
### Fixed

share/pot/clone.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ _cj_conf()
172172
if [ ! -d "$_pdir/conf" ]; then
173173
mkdir -p "$_pdir/conf"
174174
fi
175-
grep -v ^host.hostname "$_pbdir/conf/pot.conf" | \
176-
grep -v ^ip | grep -v ^vnet | grep -v ^network_type > "$_pdir/conf/pot.conf"
175+
grep -v ^host.hostname "$_pbdir/conf/pot.conf" | grep -v ^bridge \
176+
grep -v ^ip | grep -v ^vnet | grep -v ^network_type | grep -v ^pot.stack > "$_pdir/conf/pot.conf"
177177
echo "host.hostname=\"${_pname}.$( hostname )\"" >> "$_pdir/conf/pot.conf"
178178
echo "pot.stack=$_stack" >> "$_pdir/conf/pot.conf"
179179
echo "network_type=$_network_type" >> "$_pdir/conf/pot.conf"
@@ -265,7 +265,7 @@ pot-clone()
265265
_bridge_name=$OPTARG
266266
;;
267267
S)
268-
if ! is_in_list "$OPTARG" "ipv4" "ipv6" "dual" ; then
268+
if ! _is_in_list "$OPTARG" "ipv4" "ipv6" "dual" ; then
269269
_error "Network stack $OPTARG not valid"
270270
create-help
271271
${EXIT} 1

share/pot/prepare.sh

+16-3
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ prepare-help()
1818
echo ' -i ipaddr : an ip address or the keyword auto (if applicable)'
1919
echo ' -e port : the tcp port'
2020
echo ' This option can be repeated multiple time, to export more ports'
21-
echo ' -S : start immediately the newly generated pot'
2221
echo ' -B bridge-name : the name of the bridge to be used (private-bridge only)'
22+
echo ' -S network-stack : the network stack (ipv4, ipv6 or dual)'
23+
echo ' -s : start immediately the newly generated pot'
2324
}
2425

2526
pot-prepare()
@@ -34,7 +35,7 @@ pot-prepare()
3435
_bridge_name=
3536
_cmd=
3637
OPTIND=1
37-
while getopts "hvp:U:t:c:e:a:n:SN:i:B:" _o ; do
38+
while getopts "hvp:U:t:c:e:a:n:sN:i:B:S:" _o ; do
3839
case "$_o" in
3940
h)
4041
prepare-help
@@ -73,7 +74,7 @@ pot-prepare()
7374
_ports="$_ports $OPTARG"
7475
fi
7576
;;
76-
S)
77+
s)
7778
_auto_start="YES"
7879
;;
7980
N)
@@ -95,6 +96,15 @@ pot-prepare()
9596
i)
9697
_ipaddr=$OPTARG
9798
;;
99+
S)
100+
if ! _is_in_list "$OPTARG" "ipv4" "ipv6" "dual" ; then
101+
_error "Network stack $OPTARG not valid"
102+
create-help
103+
${EXIT} 1
104+
fi
105+
_network_stack="$OPTARG"
106+
;;
107+
98108
*)
99109
prepare-help
100110
${EXIT} 1
@@ -157,6 +167,9 @@ pot-prepare()
157167
if [ -n "$_ipaddr" ]; then
158168
_clone_network_opt="$_clone_network_opt -i $_ipaddr"
159169
fi
170+
if [ -n "$_network_stack" ]; then
171+
_clone_network_opt="$_clone_network_opt -S $_network_stack"
172+
fi
160173
# shellcheck disable=SC2086
161174
if ! pot-cmd clone -P "${_imported_pname}" -p "${_new_pname}" $_clone_network_opt ; then
162175
_error "Not able to clone imported pot as $_new_pname"

0 commit comments

Comments
 (0)