#!/bin/bash

#=========================================#
# Simple update notifier (DNF) v0.3.8     #
#=========================================#

EXEC="/usr/share/simple-notifier/scripts/update"
# Warn if dnf is running
RUN=$(ps -ef | grep "dnf" | grep -v grep | wc -l)
if [[ "$RUN" -gt 0 ]]; then
/usr/share/simple-notifier/warning.py
exit 0
else
script_dir="$( cd "$( dirname "$0" )" && pwd )"
script="`basename $0`"
script_path_n_name="${script_dir}/${script}"
GUI_SU="pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY"
if [ "$UID" != "0" ]; then
$GUI_SU "$EXEC"; exit;
fi
 fi
