#!/bin/bash if [[ "$UID" != 0 ]]; then echo "USER NOT ROOT" sudo "$0" exit else echo "USER IS ROOT" fi $status=$(systemctl status dnscrypt-proxy.service) if [[ "$status" != 0 ]]; then systemctl restart dnscrypt-proxy.service fi