dotfiles/files/sh/.local/bin/requires-root
2023-11-13 14:11:21 +00:00

13 lines
292 B
Bash
Executable File

#!/bin/sh
## SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
##
## SPDX-License-Identifier: AGPL-3.0-or-later
## Check if we are root, fail otherwise.
set -eu
test "$(id -u)" -eq 0 && exit 0
printf '%s\n' "Permission denied, action requires privileges."
exit 1