Magellan Linux

Annotation of /trunk/vmware-workstation/vmware-config.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1029 - (hide annotations) (download) (as text)
Sun Apr 25 20:08:11 2010 UTC (14 years, 6 months ago) by niro
File MIME type: application/x-sh
File size: 491 byte(s)
-added vmware-config

1 niro 1029 #!/bin/bash
2    
3     CONFIG_FILE="${BINDIR}/etc/vmware/config"
4    
5     remove_key()
6     {
7     local key=${1}
8     grep -v "^${key} =" ${CONFIG_FILE}
9     grep -v "^${key} =" ${CONFIG_FILE} > ${CONFIG_FILE}.tmp
10     mv ${CONFIG_FILE}.tmp ${CONFIG_FILE}
11     }
12    
13     add_key()
14     {
15     local key=${1}
16     local value=${2}
17     echo "${1} = \"${2}\"" >> ${CONFIG_FILE}
18     }
19    
20     mkdir -p $(dirname ${CONFIG_FILE})
21     touch ${CONFIG_FILE}
22    
23     if [ "${1}" == "-s" ]; then
24     remove_key ${2}
25     add_key ${2} ${3/${D}/}
26     fi
27    
28     if [ "${1}" == "-d" ]; then
29     remove_key ${2}
30     fi

Properties

Name Value
svn:executable *