This commit is contained in:
Valeria Fadeeva 2025-02-25 10:53:23 +05:00
parent d563f576b3
commit 83046d2590
3 changed files with 18 additions and 10 deletions

17
scripts/check_updates.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
ping -c 1 1.1.1.1 > /dev/null
have_internet="$?"
if [ "$have_internet" -eq 0 ]; then
echo "Checking for available updates..."
checkupdates
else
echo "There appears to be no internet connection."
fi
echo "Finish!"
echo "This window may close!"
sleep 5

View File

@ -1,9 +0,0 @@
#!/bin/bash
checkupdates
echo "Finish!"
echo "This window may close!"
sleep 5

View File

@ -105,7 +105,7 @@ fn main() {
} }
Ok(Message::CheckUpdates) => { Ok(Message::CheckUpdates) => {
// println!("Checking Updates"); // println!("Checking Updates");
let cmd = "/usr/bin/konsole --noclose --separate -e /bin/sh -c /usr/share/melawy-linux-updater-tray/scripts/checkupdates.sh"; let cmd = "/usr/bin/konsole --noclose --separate -e /bin/sh -c /usr/share/melawy-linux-updater-tray/scripts/check_updates.sh";
let _ = run_cmd(cmd, None); let _ = run_cmd(cmd, None);
glib::ControlFlow::Continue glib::ControlFlow::Continue
} }