@@ -18,8 +18,9 @@ prepare-help()
18
18
echo ' -i ipaddr : an ip address or the keyword auto (if applicable)'
19
19
echo ' -e port : the tcp port'
20
20
echo ' This option can be repeated multiple time, to export more ports'
21
- echo ' -S : start immediately the newly generated pot'
22
21
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'
23
24
}
24
25
25
26
pot-prepare ()
@@ -34,7 +35,7 @@ pot-prepare()
34
35
_bridge_name=
35
36
_cmd=
36
37
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
38
39
case " $_o " in
39
40
h)
40
41
prepare-help
@@ -73,7 +74,7 @@ pot-prepare()
73
74
_ports=" $_ports $OPTARG "
74
75
fi
75
76
;;
76
- S )
77
+ s )
77
78
_auto_start=" YES"
78
79
;;
79
80
N)
@@ -95,6 +96,15 @@ pot-prepare()
95
96
i)
96
97
_ipaddr=$OPTARG
97
98
;;
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
+
98
108
* )
99
109
prepare-help
100
110
${EXIT} 1
@@ -157,6 +167,9 @@ pot-prepare()
157
167
if [ -n " $_ipaddr " ]; then
158
168
_clone_network_opt=" $_clone_network_opt -i $_ipaddr "
159
169
fi
170
+ if [ -n " $_network_stack " ]; then
171
+ _clone_network_opt=" $_clone_network_opt -S $_network_stack "
172
+ fi
160
173
# shellcheck disable=SC2086
161
174
if ! pot-cmd clone -P " ${_imported_pname} " -p " ${_new_pname} " $_clone_network_opt ; then
162
175
_error " Not able to clone imported pot as $_new_pname "
0 commit comments