Bloody hell! Wi-fi requires root? It never used to on Debian Bullseye or OpenSUSE Leap 15.3 a few years ago.
Network service: which one? Partial output of systemctl:
NetworkManager.service loaded active running
network-pre.target loaded active active
network.target loaded active active
Judging by the first line, this script is a set of Bash commands.
If this line is there, when the script is executed it will run as a Bash script.
This line is required for it to work as a Bash script; if it isn’t there, it will execute using the kernel, and it won’t work because it’s not a binary program.
If you want it all in one line, just copy and paste it into a terminal that already runs Bash, and exclude the first line. But why do you want it in one line in the first place? Multiline scripts have no performance drop, and they are more readable.