#!/bin/bash

NETWORK_ALIVE=`ping -c1 google.com 2>&1 | grep unknown`

while [[ "$NETWORK_ALIVE" != "" ]];do
NETWORK_ALIVE=`ping -c1 google.com 2>&1 | grep unknown`
sleep 10
done

if [[ NETWORK_ALIVE == '' ]];then
pacman -Syy
fi
