Skip to content

Looking for help regarding a bash script #21371

Answered by Wabri
Ellaina22 asked this question in General
Discussion options

You must be logged in to vote

Hi @ellaina22,

You can replace your script with this:

#!/bin/bash

Wifi=$(lspci | grep -i net | grep 'Network controller');

if [[$Wifi == "Network controller"]];
then
echo "|Wifi ON| |" > wifion.md;
else
echo "|NO Wifi| |" > nowifi.md;
fi

the line with the declaration of the Wifi retrive only the ‘Network controller’ line and than inside the if controll statement you need to replace the >> with only one >, this rewrite completely the file and you can remove the first two line of remove.

Hope this help, ask if you need farther infos…

-Gabriele-

Mark helpfull posts with Accept as Solution to help other users locate important info. Don’t forget to give Kudos for great contents!

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants