Skip to content

Commit 86724d3

Browse files
committed
Fix ShellCheck warnings: separate declare and assign
1 parent 537fcaf commit 86724d3

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/nm-hotspot

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ create_hotspot() {
152152
fi
153153

154154
# Get WiFi device
155-
local DEVICE=$(get_wifi_device)
155+
local DEVICE
156+
DEVICE=$(get_wifi_device)
156157
if [ -z "$DEVICE" ]; then
157158
print_error "No wireless device found"
158159
exit 1
@@ -222,7 +223,8 @@ stop_hotspot() {
222223
}
223224

224225
show_status() {
225-
local DEVICE=$(get_wifi_device)
226+
local DEVICE
227+
DEVICE=$(get_wifi_device)
226228

227229
echo ""
228230
print_info "=== Hotspot Status ==="
@@ -231,8 +233,10 @@ show_status() {
231233
print_success "Status: ACTIVE"
232234

233235
# Get connection details
234-
local SSID=$(nmcli -t -f 802-11-wireless.ssid connection show "$CONNECTION_NAME" | cut -d: -f2)
235-
local BAND=$(nmcli -t -f 802-11-wireless.band connection show "$CONNECTION_NAME" | cut -d: -f2)
236+
local SSID
237+
local BAND
238+
SSID=$(nmcli -t -f 802-11-wireless.ssid connection show "$CONNECTION_NAME" | cut -d: -f2)
239+
BAND=$(nmcli -t -f 802-11-wireless.band connection show "$CONNECTION_NAME" | cut -d: -f2)
236240

237241
echo "SSID: $SSID"
238242
echo "Band: $BAND ($([ "$BAND" = "bg" ] && echo "2.4GHz" || echo "5GHz"))"

0 commit comments

Comments
 (0)