# 1. If ~/.config/VirtualBox/enable exists, the user accepts the security risk.
# 2. If ~/.config/VirtualBox/disable exists, the user does not accept the risk. That file will contain the inode of /usr/lib/udev/rules.d/60-vboxdrv.rules.
# When that changes, the VBoxUSB_DevRules will again be displayed as that means that VB has been reloaded.
#
devrules()
{
/usr/lib/virtualbox/VBoxUSB_DevRules
if[$? -eq 0];then
# User accepts the risk
touch ~/.config/VirtualBox/enable
rm -f ~/.config/VirtualBox/disable
else
# User declines the risk - save the inode
echo"" > ~/.config/VirtualBox/disable
rm -f ~/.config/VirtualBox/enable
fi
}
# Start of main routine
#
# Ensure that ~/.config/VirtualBox exists
mkdir -p ~/.config/VirtualBox
# Get the inode for /usr/lib/udev/rules.d/60-vboxdrv.rules