summaryrefslogtreecommitdiffstats
path: root/recipes-containers/vcontainer
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2026-01-08 14:32:28 +0000
committerBruce Ashfield <bruce.ashfield@gmail.com>2026-02-09 03:32:52 +0000
commit6cd8f5c67a439bb2ca05da2b608a77c1622ea38c (patch)
tree03bbb0dd2a932ead9d0abcdcf36919c71896f71c /recipes-containers/vcontainer
parent1370e09b17128885542fec69e9cff8642029706d (diff)
downloadmeta-virtualization-6cd8f5c67a439bb2ca05da2b608a77c1622ea38c.tar.gz
vcontainer-common: remove 'local' keywords from case blocks
The 'local' keyword can only be used inside functions, not in the main script's case blocks. Remove 'local' from variables in the run, ps, and vmemres case handlers. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-containers/vcontainer')
-rwxr-xr-xrecipes-containers/vcontainer/files/vcontainer-common.sh20
1 files changed, 10 insertions, 10 deletions
diff --git a/recipes-containers/vcontainer/files/vcontainer-common.sh b/recipes-containers/vcontainer/files/vcontainer-common.sh
index 7d7c0ee6..3e8489aa 100755
--- a/recipes-containers/vcontainer/files/vcontainer-common.sh
+++ b/recipes-containers/vcontainer/files/vcontainer-common.sh
@@ -1319,7 +1319,7 @@ case "$COMMAND" in
1319 1319
1320 # Show host port forwards if daemon is running and we have any 1320 # Show host port forwards if daemon is running and we have any
1321 if daemon_is_running; then 1321 if daemon_is_running; then
1322 local pf_file=$(get_port_forward_file) 1322 pf_file=$(get_port_forward_file)
1323 if [ -f "$pf_file" ] && [ -s "$pf_file" ]; then 1323 if [ -f "$pf_file" ] && [ -s "$pf_file" ]; then
1324 echo "" 1324 echo ""
1325 echo -e "${CYAN}Host Port Forwards (QEMU):${NC}" 1325 echo -e "${CYAN}Host Port Forwards (QEMU):${NC}"
@@ -1993,8 +1993,8 @@ case "$COMMAND" in
1993 RUN_PORT_FORWARDS=() 1993 RUN_PORT_FORWARDS=()
1994 1994
1995 # Parse COMMAND_ARGS to extract relevant flags 1995 # Parse COMMAND_ARGS to extract relevant flags
1996 local i=0 1996 i=0
1997 local prev_arg="" 1997 prev_arg=""
1998 for arg in "${COMMAND_ARGS[@]}"; do 1998 for arg in "${COMMAND_ARGS[@]}"; do
1999 case "$arg" in 1999 case "$arg" in
2000 -v|--volume) 2000 -v|--volume)
@@ -2113,10 +2113,10 @@ case "$COMMAND" in
2113 for port_spec in "${RUN_PORT_FORWARDS[@]}"; do 2113 for port_spec in "${RUN_PORT_FORWARDS[@]}"; do
2114 # Parse port specification: [host_ip:]host_port:container_port[/protocol] 2114 # Parse port specification: [host_ip:]host_port:container_port[/protocol]
2115 # Examples: 8080:80, 127.0.0.1:8080:80, 8080:80/tcp, 8080:80/udp 2115 # Examples: 8080:80, 127.0.0.1:8080:80, 8080:80/tcp, 8080:80/udp
2116 local spec="$port_spec" 2116 spec="$port_spec"
2117 local protocol="tcp" 2117 protocol="tcp"
2118 local host_port="" 2118 host_port=""
2119 local guest_port="" 2119 guest_port=""
2120 2120
2121 # Extract protocol if present 2121 # Extract protocol if present
2122 if echo "$spec" | grep -q '/'; then 2122 if echo "$spec" | grep -q '/'; then
@@ -2125,7 +2125,7 @@ case "$COMMAND" in
2125 fi 2125 fi
2126 2126
2127 # Count colons to determine format 2127 # Count colons to determine format
2128 local colon_count=$(echo "$spec" | tr -cd ':' | wc -c) 2128 colon_count=$(echo "$spec" | tr -cd ':' | wc -c)
2129 if [ "$colon_count" -eq 2 ]; then 2129 if [ "$colon_count" -eq 2 ]; then
2130 # Format: host_ip:host_port:container_port (ignore host_ip for now) 2130 # Format: host_ip:host_port:container_port (ignore host_ip for now)
2131 host_port=$(echo "$spec" | cut -d: -f2) 2131 host_port=$(echo "$spec" | cut -d: -f2)
@@ -2232,7 +2232,7 @@ case "$COMMAND" in
2232 ;; 2232 ;;
2233 stop) 2233 stop)
2234 # Clear port forward registry when stopping daemon 2234 # Clear port forward registry when stopping daemon
2235 local pf_file=$(get_port_forward_file) 2235 pf_file=$(get_port_forward_file)
2236 if [ -f "$pf_file" ]; then 2236 if [ -f "$pf_file" ]; then
2237 rm -f "$pf_file" 2237 rm -f "$pf_file"
2238 fi 2238 fi
@@ -2240,7 +2240,7 @@ case "$COMMAND" in
2240 ;; 2240 ;;
2241 restart) 2241 restart)
2242 # Stop if running and clear port forward registry 2242 # Stop if running and clear port forward registry
2243 local pf_file=$(get_port_forward_file) 2243 pf_file=$(get_port_forward_file)
2244 if [ -f "$pf_file" ]; then 2244 if [ -f "$pf_file" ]; then
2245 rm -f "$pf_file" 2245 rm -f "$pf_file"
2246 fi 2246 fi