#!/bin/bash if [[ "$UID" != 0 ]]; then echo "USER NOT ROOT" sudo "$0" exit else echo "USER IS ROOT" fi $status=$(systemctl status tuned tuned-ppd) if [[ "$status" != 0 ]]; then systemctl restart tuned tuned-ppd # systemctl --user restart plasma-plasmashell fi