From 83046d25901bac3cba99318338eb7f6b1d8999eb Mon Sep 17 00:00:00 2001 From: Valeria Fadeeva Date: Tue, 25 Feb 2025 10:53:23 +0500 Subject: [PATCH] Update --- scripts/check_updates.sh | 17 +++++++++++++++++ scripts/checkupdates.sh | 9 --------- src/main.rs | 2 +- 3 files changed, 18 insertions(+), 10 deletions(-) create mode 100755 scripts/check_updates.sh delete mode 100755 scripts/checkupdates.sh diff --git a/scripts/check_updates.sh b/scripts/check_updates.sh new file mode 100755 index 0000000..7351908 --- /dev/null +++ b/scripts/check_updates.sh @@ -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 diff --git a/scripts/checkupdates.sh b/scripts/checkupdates.sh deleted file mode 100755 index d60d648..0000000 --- a/scripts/checkupdates.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -checkupdates - -echo "Finish!" - -echo "This window may close!" - -sleep 5 diff --git a/src/main.rs b/src/main.rs index 302f7d2..fb5a133 100644 --- a/src/main.rs +++ b/src/main.rs @@ -105,7 +105,7 @@ fn main() { } Ok(Message::CheckUpdates) => { // 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); glib::ControlFlow::Continue }