9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync# Start the Guest Additions X11 Client
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync# Copyright (C) 2007-2012 Oracle Corporation
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync# available from http://www.virtualbox.org. This file is free software;
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync# you can redistribute it and/or modify it under the terms of the GNU
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync# General Public License (GPL) as published by the Free Software
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync# Sanity check: if non-writeable PID-files are present in the user home
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync# directory VBoxClient will fail to start.
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync test -w $i || rm -f $i
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsyncif test -f /proc/modules && ! grep -q vboxguest /proc/modules 2>/dev/null; then
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync # Do not start if the kernel module is not present.
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync notify-send "VBoxClient: the VirtualBox kernel service is not running. Exiting."
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsyncelif test -z "${SSH_CONNECTION}"; then
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync # This script can also be triggered by a connection over SSH, which is not
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync # what we had in mind, so we do not start VBoxClient in that case. We do
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync # not use "exit" here as this script is "source"d, not executed.