Browse Source

Prevent empty ns1 / ns2 to be used (#3683)

Jaap Marcus 2 years ago
parent
commit
c8a6365bd8
1 changed files with 7 additions and 0 deletions
  1. 7 0
      bin/v-change-user-ns

+ 7 - 0
bin/v-change-user-ns

@@ -39,6 +39,13 @@ check_args '3' "$#" 'USER NS1 NS2 [NS3] [NS4] [NS5] [NS6] [NS7] [NS8]'
 # Checking argument format
 # Checking argument format
 is_format_valid 'user' 'ns1' 'ns2'
 is_format_valid 'user' 'ns1' 'ns2'
 
 
+if [ "$ns1" = '' ]; then
+	check_result '3' "Usage: v-change-user-ns USER NS1 NS2 [NS3] [NS4] [NS5] [NS6] [NS7] [NS8]"
+fi
+if [ "$ns2" = '' ]; then
+	check_result '3' "Usage: v-change-user-ns USER NS1 NS2 [NS3] [NS4] [NS5] [NS6] [NS7] [NS8]"
+fi
+
 ns="$ns1,$ns2"
 ns="$ns1,$ns2"
 if [ -n "$ns3" ]; then
 if [ -n "$ns3" ]; then
 	is_format_valid 'ns3'
 	is_format_valid 'ns3'