Hi I was just wondering if this script looks ok I run it after I login thanks.
#!/bin/bash
echo "hi, starting wifi, nft and desktop"
sudo ls
sudo systemctl start wpaStart.service
sudo nft -f ~/config/nftLocal
startxfce4
edit:
I wanted the script to start my wifi and add nft rules because those things (weren't) working.
I tried running wpa_supplicant but it didn't start properly. wpaStart is this:
cat usr/bin/wpaStart
#!/bin/bash
wpa_supplicant -B -i wlp1s0f0u9 -c /etc/wpa_supplicant/wpa_supplicant.conf
Also thanks for the nftables advice I'll try it. I'm not sure my Nft configuration file was working properly as I have a small network for my lan card. It was maybe overwriting the file. (/etc/systemd/network/20-wired.network)
sudo ls is because I'm just "prepping" sudo so that you enter the password properly. echo is "being friendly".
edit 2:
I tried enabling wpaStart.service and got the same error as before after restarting.
Nov 25 20:59:32 archlinux2 systemd[1]: wpaStart.service: Main process exited, code=exited, status=255/EXCEPTION
I'll keep this script for now and might also try a cron job.
Also my sshd service fails in the log(just like wifi). So I may try it in a cron job.
I still have to re-try the nft solutions.
Also I now use
exec startxfce4
sudo lsseems pointless, as does theecho. Who will be running this? How? How do you give the password? Is the script running interactively?sudos that you shouldn't: it starts services that should almost certainly be activated in a different way, running a program on a user-owned directory but as root user (leading to fun ownerships and exploitability effects). And, startingnftafter your network comes up is another really bad idea. This all screams "your system has useful session management built, in, but somehow you're trying to use it as if you only had desktop linuxes of the year 1995, and it's biting you".sudo ls? That would be justified only if the user's$HOME(or current directory where the script is executed) wasn't executable by the user and the user's group, which if true would pose bigger issues. Otherwise, it is unnecessary, just usels(still, why?).