Skip to content

Commit

Permalink
check is user running script is part of libvirt group
Browse files Browse the repository at this point in the history
  • Loading branch information
Pearl1594 committed Sep 23, 2024
1 parent b1ccf9d commit 8dadb49
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/vm/hypervisor/kvm/nasbackup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ sanity_checks() {
echo "Failure... \tYour QEMU version $hvVersion or libvirt version $libvVersion is unsupported. Consider upgrading to the required minimum version of QEMU: 4.2.0 and Libvirt: 7.2.0"
exit 1
fi

echo "Checking Permissions"
if groups $USER | grep -q '\blibvirt\b'; then
echo "Success... User $USER is part of libvirt group"
else
echo "Failure - User $USER is not part of libvirt group"
exit 1
fi
echo "Environment Sanity Checks successfully passed"
}

### Operation methods ###
Expand Down

0 comments on commit 8dadb49

Please sign in to comment.