summaryrefslogtreecommitdiff
path: root/find-deprecated-pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'find-deprecated-pkgs')
-rwxr-xr-xfind-deprecated-pkgs17
1 files changed, 11 insertions, 6 deletions
diff --git a/find-deprecated-pkgs b/find-deprecated-pkgs
index 3be7b0f..35ebd56 100755
--- a/find-deprecated-pkgs
+++ b/find-deprecated-pkgs
@@ -87,6 +87,14 @@ mkpkglist() {
esac
}
+err() {
+ printf '%sError:%s %s\n' \
+ "$(tput setaf 1)" \
+ "$(tput sgr0)" \
+ "$1"
+ false
+}
+
check(){
mkpkglist $1
case $1 in
@@ -100,11 +108,7 @@ check(){
grep ^$p $arch_pkgs &> /dev/null || printf '%s was not found\n' "$p"
done
;;
- *) printf '%sError:%s %s is not a valid argument\n' \
- "$(tput setaf 1)" \
- "$(tput sgr0)" \
- "$1"
- false
+ *) err "$1 is not a valid argument"
;;
esac
}
@@ -112,5 +116,6 @@ check(){
if [ -s $1 ]; then
usage
else
- check $1 || STATUS=$? usage
+ ping -q -w 1 -c 1 `ip r | grep ^default | awk '{print $3}'` &> /dev/null || err 'You are not connected to internet'
+ check $1 || STATUS=$? usage
fi