3d8a8a5570
git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/vmware@1339 6952d904-891a-0410-993b-d76249ca496b
75 lines
1.5 KiB
Plaintext
75 lines
1.5 KiB
Plaintext
#!/sbin/runscript
|
||
# Copyright 1999-2004 Gentoo Foundation
|
||
# Distributed under the terms of the GNU General Public License v2
|
||
# $Header: /var/cvsroot/gentoo-x86/app-emulation/vmware-workstation/files/vmware-workstation.rc,v 1.6 2007/11/25 12:50:32 ikelos Exp $
|
||
|
||
depend() {
|
||
need localmount
|
||
use logger net hald
|
||
after samba
|
||
}
|
||
|
||
vmware_prettify() {
|
||
# Yea, the code is ugly but the output is pretty
|
||
state=$1
|
||
waserror=0
|
||
msgtype=0
|
||
while read line
|
||
do
|
||
[ "${line}" = "" ] && continue
|
||
if [ ${msgtype} -le 0 ]
|
||
then
|
||
if [ ${msgtype} -eq -1 ]
|
||
then
|
||
ewarn ${line}
|
||
continue
|
||
fi
|
||
case ${line} in
|
||
*:*)
|
||
einfon ${line}
|
||
echo
|
||
eend 0
|
||
msgtype=1;;
|
||
*)
|
||
ewarn ${line}
|
||
msgtype=-1
|
||
waserror=1;;
|
||
esac
|
||
continue
|
||
fi
|
||
|
||
# Strip out anything after the <esc> code
|
||
message=`echo ${line} | sed -e "s/^\(.*\).*$/\1/"`
|
||
einfon " ${message}"
|
||
echo
|
||
|
||
echo ${line} | grep -q done
|
||
status=$?
|
||
eend ${status}
|
||
|
||
if [ ${status} -eq 0 ]
|
||
then
|
||
logger -p local0.err -t vmware-${state} "${line}"
|
||
waserror=${status}
|
||
fi
|
||
done
|
||
if [ "${msgtype}" = "-1" ]
|
||
then
|
||
eend 1 "VMware is not properly configured! See above."
|
||
fi
|
||
return ${waserror}
|
||
}
|
||
|
||
start() {
|
||
test -x /etc/vmware-converter/init.d/vmware-converter || \
|
||
eend 1 "vmware init script not found. Aborting" || return 1
|
||
|
||
/etc/vmware-converter/init.d/vmware-converter start | vmware_prettify start
|
||
return $?
|
||
}
|
||
|
||
stop() {
|
||
/etc/vmware-converter/init.d/vmware-converter stop | vmware_prettify stop
|
||
return $?
|
||
}
|