#!/usr/bin/sh

paru -Syu

if [ $? -eq 0 ]; then
    echo "UPDATE SUCCEDEED"
else
    echo "UPDATE FAILED"
    exit 1
fi


echo "==================================================================="


if [ -x "$(command -v doas)" ]
then
    doas checkservices
else
    sudo checkservices
fi

if [ $? -eq 0 ]; then
    echo "CHECKSERVICES SUCCEDEED"
else
    echo "CHECKSERVICES FAILED"
    exit 1
fi