Skip to content

Commit

Permalink
disko-install: check if it runs as root
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 authored and mergify[bot] committed Mar 26, 2024
1 parent 5d2d3e4 commit a6717b1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion disko-install
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ parseArgs() {
exit 1
;;
esac
mode=$2
shift
;;
--extra-files)
Expand Down Expand Up @@ -155,6 +154,12 @@ main() {
exit 1
fi

# check if we are root
if [[ "$EUID" -ne 0 ]]; then
echo "This script must be run as root" >&2
exit 1
fi

if [[ $flake =~ ^(.*)\#([^\#\"]*)$ ]]; then
flake="${BASH_REMATCH[1]}"
flakeAttr="${BASH_REMATCH[2]}"
Expand Down

0 comments on commit a6717b1

Please sign in to comment.