DEV Community

wruta
wruta

Posted on • Edited on

lightdm script

Hello guys
I'm trying to run a script at boot on Ubuntu 22 OS that will check if the device is connected to the internet or not. If it isn't, the script will run the "armbian-config" command to open a system configuration screen and edit the network configuration, the script is running fine but i can't execute it to run automatically at boot.
i tried :
$ sudo nano /usr/share/check_network.sh

#!/bin/bash
ping -c 1 google.com
if [ $? -ne 0 ]; then

  echo "configure your network" | bash -c "read; armbian-config"
fi
Enter fullscreen mode Exit fullscreen mode

$ sudo nano /etc/lightdm/lightdm.conf

[Seat:*]
display-setup-script=/usr/share/check_network.sh
Enter fullscreen mode Exit fullscreen mode

i also tried
$ sudo nano /usr/share/xgreeters/slick-greeter.desktop

Exec=/bin/bash /usr/share/check_network.sh
Enter fullscreen mode Exit fullscreen mode

any idea would be appreciated..

Top comments (0)