#!/bin/bash

# Pearl APTus Upgrade is a simply tool for upgrading the system
# Created by Paweł "pavroo" Pijanowski 2014/10/31
# Copyright 2014-2020 under the GNU GPL2 License
# Last update 2020/01/12

# It runs full system upgrade in a text console

# check out connection to debian server
PINGTEST0=$(ping -c 1 debian.org | grep [0-9])
if [ "$PINGTEST0" = "" ]; then
	echo "Debian server is not reachable, exiting..."
	exit 1
else
	echo "Debian server is on, proceed..."
	sleep 1
fi

# check out connection to pearl server
PINGTEST1=$(ping -c 1 pearllinux.net | grep [0-9])
if [ "$PINGTEST1" = "" ]; then
	echo "Pearl server is not reachable, exiting..."
	exit 1
else
	echo "Pearl server is on, proceed..."
	sleep 1
fi

sudo apt update && sudo apt full-upgrade --no-install-recommends

exit 0
