diff --git a/home/.chezmoiscripts/universal/run_onchange_after_46_virtualbox.sh.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_46_virtualbox.sh.tmpl index 3baa3ee8..30aa0b4b 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_46_virtualbox.sh.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_46_virtualbox.sh.tmpl @@ -27,12 +27,14 @@ if command -v VirtualBox > /dev/null; then ### Download extension pack logg info 'Downloading VirtualBox extension pack' curl -sSL https://download.virtualbox.org/virtualbox/$VBOX_VERSION/Oracle_VM_VirtualBox_Extension_Pack-$VBOX_VERSION.vbox-extpack \ - -o /tmp/vbox/Oracle_VM_VirtualBox_Extension_Pack-$VBOX_VERSION.vbox-extpack + -o /tmp/vbox/Oracle_VM_VirtualBox_Extension_Pack-$VBOX_VERSION.vbox-extpack || logg error 'Failed to download the VirtualBox extension pack so the extension pack installation will be skipped' ### Install extension pack - logg info 'Installing VirtualBox extension pack' - echo 'y' | sudo VBoxManage extpack install --replace /tmp/vbox/Oracle_VM_VirtualBox_Extension_Pack-$VBOX_VERSION.vbox-extpack - logg success 'Successfully installed VirtualBox extension pack' + if [ -f /tmp/vbox/Oracle_VM_VirtualBox_Extension_Pack-$VBOX_VERSION.vbox-extpack ]; then + logg info 'Installing VirtualBox extension pack' + echo 'y' | sudo VBoxManage extpack install --replace /tmp/vbox/Oracle_VM_VirtualBox_Extension_Pack-$VBOX_VERSION.vbox-extpack + logg success 'Successfully installed VirtualBox extension pack' + fi else logg info 'VirtualBox Extension pack is already installed' fi