Use defined variable instead of full path

This commit is contained in:
Eduard Tolosa 2018-11-19 23:39:02 -05:00
parent 6102260b2a
commit 6c1f3308ef

View file

@ -14,7 +14,7 @@ if command -v wget > /dev/null; then
# Check internet connection and if not OK then restart all networking services # Check internet connection and if not OK then restart all networking services
echo "Testing your connection..." echo "Testing your connection..."
wget -q --tries=1 --timeout=1 https://google.com -O $ofile &> /dev/null wget -q --tries=1 --timeout=1 https://google.com -O $ofile &> /dev/null
if [ ! -s /tmp/google.txt ]; then if [ ! -s $ofile ]; then
echo "Your connection is not working, restarting your network services: $services" echo "Your connection is not working, restarting your network services: $services"
sudo systemctl restart $services sudo systemctl restart $services
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then