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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

AWS Security LIVE!

Hosted by security experts, AWS Security LIVE! showcases AWS Partners tackling real-world security challenges. Join live and get your security questions answered.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️