1 | # Oracle VM VirtualBox
|
---|
2 | # VirtualBox Linux pre-uninstaller common portions
|
---|
3 | #
|
---|
4 |
|
---|
5 | # Copyright (C) 2015 Oracle Corporation
|
---|
6 | #
|
---|
7 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
8 | # available from http://www.virtualbox.org. This file is free software;
|
---|
9 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
10 | # General Public License (GPL) as published by the Free Software
|
---|
11 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
12 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
13 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
14 |
|
---|
15 | # Put bits of the pre-uninstallation here which should work the same for all of
|
---|
16 | # the Linux installers. We do not use special helpers (e.g. dh_* on Debian),
|
---|
17 | # but that should not matter, as we know what those helpers actually do, and we
|
---|
18 | # have to work on those systems anyway when installed using the all
|
---|
19 | # distributions installer.
|
---|
20 | #
|
---|
21 | # We assume that all required files are in the same folder as this script
|
---|
22 | # (e.g. /opt/VirtualBox, /usr/lib/VirtualBox, the build output directory).
|
---|
23 | #
|
---|
24 | # Script exit status: 0 on success, 1 if VirtualBox is running and can not be
|
---|
25 | # stopped (installers may show an error themselves or just pass on standard
|
---|
26 | # error).
|
---|
27 |
|
---|
28 | # This is GNU-specific, sorry Solaris.
|
---|
29 | MY_PATH="$(dirname $(readlink -f -- "${0}"))/"
|
---|
30 | cd "${MY_PATH}"
|
---|
31 | . "./routines.sh"
|
---|
32 |
|
---|
33 | # Stop the ballon control service
|
---|
34 | stop_init_script vboxballoonctrl-service 2>/dev/null
|
---|
35 | # Stop the autostart service
|
---|
36 | stop_init_script vboxautostart-service 2>/dev/null
|
---|
37 | # Stop the web service
|
---|
38 | stop_init_script vboxweb-service 2>/dev/null
|
---|
39 | # Do this check here after we terminated the web service: check whether VBoxSVC
|
---|
40 | # is running and exit if it can't be stopped.
|
---|
41 | check_running
|
---|
42 | # Terminate VBoxNetDHCP if running
|
---|
43 | terminate_proc VBoxNetDHCP
|
---|
44 | # Terminate VBoxNetNAT if running
|
---|
45 | terminate_proc VBoxNetNAT
|
---|
46 | delrunlevel vboxballoonctrl-service
|
---|
47 | remove_init_script vboxballoonctrl-service
|
---|
48 | delrunlevel vboxautostart-service
|
---|
49 | remove_init_script vboxautostart-service
|
---|
50 | delrunlevel vboxweb-service
|
---|
51 | remove_init_script vboxweb-service
|
---|
52 | # Stop kernel module and uninstall runlevel script
|
---|
53 | stop_init_script vboxdrv 2>/dev/null
|
---|
54 | delrunlevel vboxdrv
|
---|
55 | remove_init_script vboxdrv
|
---|
56 | # Stop host networking and uninstall runlevel script (obsolete)
|
---|
57 | stop_init_script vboxnet 2>/dev/null
|
---|
58 | delrunlevel vboxnet 2>/dev/null
|
---|
59 | remove_init_script vboxnet 2>/dev/null
|
---|
60 | rm -f /sbin/vboxconfig
|
---|
61 | exit 0
|
---|