Skip to content

Commit 8dadb49

Browse files
committed
check is user running script is part of libvirt group
1 parent b1ccf9d commit 8dadb49

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

scripts/vm/hypervisor/kvm/nasbackup.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@ sanity_checks() {
7070
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"
7171
exit 1
7272
fi
73+
74+
echo "Checking Permissions"
75+
if groups $USER | grep -q '\blibvirt\b'; then
76+
echo "Success... User $USER is part of libvirt group"
77+
else
78+
echo "Failure - User $USER is not part of libvirt group"
79+
exit 1
80+
fi
81+
echo "Environment Sanity Checks successfully passed"
7382
}
7483

7584
### Operation methods ###

0 commit comments

Comments
 (0)