.dots/scripts/powertop/powertop.sh

19 lines
473 B
Bash
Raw Normal View History

2024-10-01 15:57:03 +02:00
#!/usr/bin/env zsh
# author: Daniel Sommer <daniel.sommer@velvettear.de>
# license: MIT
# exit on error
set -e
# check permissions
[[ "$EUID" != 0 ]] && printf "error: permission denied!\n" >&2 && exit 1
# check if script exists
script="$(dirname $(realpath "$0"))/$(hostname).sh"
[[ ! -x "$script" ]] && printf "error: script '"$script"' does not exist or is not executable!\n" >&2 && exit 1
# execute script
printf ">> executing script '"$script"'...\n"
. "$script"