mirror of
https://github.com/Kicksecure/security-misc.git
synced 2025-11-25 22:48:24 -05:00
Add kill-vboxdrmclient-on-shutdown.service
This commit is contained in:
parent
9d86379f56
commit
5fbd42bbec
3 changed files with 46 additions and 0 deletions
|
|
@ -0,0 +1,29 @@
|
|||
#!/bin/bash
|
||||
|
||||
## Copyright (C) 2025 - 2025 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
|
||||
## See file COPYING for copying conditions.
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o errtrace
|
||||
set -o pipefail
|
||||
|
||||
vboxdrmclient_sock='/tmp/.iprt-localipc-DRMIpcServer'
|
||||
|
||||
if ! [ -S "$vboxdrmclient_sock" ]; then
|
||||
printf '%s\n' "'$vboxdrmclient_sock' does not exist or is not a socket, ok."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
sock_pid="$(/usr/libexec/helper-scripts/query-sock-pid "$vboxdrmclient_sock")" || true
|
||||
if [ -z "$sock_pid" ]; then
|
||||
printf '%s\n' "Cannot get PID listening on '$vboxdrmclient_sock', ok."
|
||||
exit 0
|
||||
fi
|
||||
if kill -SIGKILL "$sock_pid"; then
|
||||
printf '%s\n' "Killed VBoxDRMClient ('$sock_pid'), ok."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
printf '%s\n' "ERROR: Could not kill VBoxDRMClient ('$sock_pid')!"
|
||||
exit 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue