I've taken a look at every question regarding systemd here and cannot seem to find the answer, so I apologize if I'm somehow missing it.
I just want to run the following script at startup, but it seems it must be after systemd finishes because it is dependent upon the network and gui to be up. I'm trying to set up the mousepad to allow tap-clicking, and trying to run a connect.sh script which connects me to a VPN. The following script does everything it's supposed to do when I run it manually, but I cannot for the life of me figure out why it won't run at startup.
#! /bin/sh # /root/Scripts/startup.sh synclient tapbutton1=1 clickfinger2=3 tapbutton2=3 sleep 2 sh /root/Scripts/connect.sh sleep 10
contents of connect.sh:
#! /bin/sh # /root/Scripts/connect.sh echo "disabling wifi adapter..\n" ifconfig wlan0 down sleep 3 macchanger -r wlan0 echo "enabling wifi adapter..\n" ifconfig wlan0 up sleep 3 echo "connecting to VPN..\n" nmcli con up id vpnconnection1 sleep 3 ifconfig echo "finished\n"
[Unit] After=network.target [Service] ExecStart=/root/Scripts/startup.sh [Install] WantedBy=default.target
systemctl enable mystartup.service and reboot, but the script clearly hasn't run since the changes have not taken effect.
What am I doing wrong?
EDIT: I updated the scripts to reflect the absolute paths to the script locations. ran
systemctl and rebooted, but still not working.
For more clarification, I just want to run these two scripts at startup. Registering them as a service doesn't make sense to me, but everything I've researched has brought me here. That said,
systemctl --state=failed doesn't show mystartup.service listed, and
service mystartup.service status says
Unit mystartup.service.service could not be found.