Subversion Repositories DevTools

Rev

Rev 3993 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3993 Rev 5273
Line 95... Line 95...
95
#   Non Manual: Only run once
95
#   Non Manual: Only run once
96
#
96
#
97
[ -z "$startupMode" -a -f /root/.vix/config ] && exit
97
[ -z "$startupMode" -a -f /root/.vix/config ] && exit
98
 
98
 
99
#
99
#
-
 
100
#   Running full script
-
 
101
#   Perform full logging to another log file
-
 
102
mkdir -p /root/.vix
-
 
103
exec 1>/root/.vix/vix_full.log 2>&1
-
 
104
echo Starting $*
-
 
105
env
-
 
106
set -x
-
 
107
 
-
 
108
#
100
#   Create the Help Text
109
#   Create the Help Text
101
#   Place link to this script on the Desktop
110
#   Place link to this script on the Desktop
102
#
111
#
103
[ -e /root/Desktop/configureVM ] || /root/Desktop/configureVM
112
[ -e /root/Desktop/configureVM ] || /root/Desktop/configureVM
104
createHelpText
113
createHelpText
Line 139... Line 148...
139
    [[ $mname =~ AUPERAWSx ]] && ok=false
148
    [[ $mname =~ AUPERAWSx ]] && ok=false
140
    [[ $mname =~ VMnn ]] && ok=false
149
    [[ $mname =~ VMnn ]] && ok=false
141
done
150
done
142
 
151
 
143
ok=false
152
ok=false
144
prompt="<pre>Stand Alone VM:        No NIS, Setup local user\
153
prompt="<pre>Stand Alone VM:        No  NIS, Setup local user\
145
         <br>Local Home:            Use NIS, Setup local home\
154
         <br>Local Home:            Use NIS, Setup local home\
146
         <br>Automount home drives: Use NIS, Mount Unix Home Drive\
155
         <br>Automount home drives: Use NIS, Mount Unix Home Drive\
147
        </pre>Select configuration:"
156
        </pre>Select configuration:"
148
while ! $ok ; do
157
while ! $ok ; do
149
    umode=$(kdialog --title "$TITLE" --combobox "$prompt" \
158
    umode=$(kdialog --title "$TITLE" --combobox "$prompt" \
Line 178... Line 187...
178
    utext=$(kdialog --title "$TITLE" --inputbox "$prompt" "$utext")
187
    utext=$(kdialog --title "$TITLE" --inputbox "$prompt" "$utext")
179
    [[ "$utext" =~ ^[a-zA-Z][a-zA-Z0-9_-]+$ ]] && ok=true
188
    [[ "$utext" =~ ^[a-zA-Z][a-zA-Z0-9_-]+$ ]] && ok=true
180
done
189
done
181
pkgServer="$utext"
190
pkgServer="$utext"
182
 
191
 
183
erase=
192
erase=1
184
if [ -n "$startupMode" ]; then
193
if [ -n "$startupMode" ]; then
185
    kdialog --title "$TITLE" --yesno \
194
    kdialog --title "$TITLE" --yesno \
186
        "This utility is being manually run.<br>\
195
        "This utility is being manually run.<br>\
187
        Do you want to force the script to be run on the next reboot"
196
        Do you want to force the script to be run on the next reboot"
188
    erase=$?
197
    erase=$?
Line 203... Line 212...
203
hereData
212
hereData
204
 
213
 
205
################################################################################
214
################################################################################
206
#
215
#
207
#   Perform the initialisation
216
#   Perform the initialisation
-
 
217
#
-
 
218
echo "--------------------------------"
-
 
219
echo "Data collected. Configure system"
-
 
220
 
-
 
221
# Extend the path
-
 
222
PATH="/sbin:$PATH"
208
 
223
 
209
# Machine-specific, so remove in case this system is going to be
224
# Machine-specific, so remove in case this system is going to be
210
# cloned.  These will be regenerated on the first boot.
225
# cloned.  These will be regenerated on the first boot.
211
if [ -z "$startupMode" ] ; then
226
if [ -z "$startupMode" ] ; then
212
    rm -f /etc/udev/rules.d/70-persistent-cd.rules
227
    rm -f /etc/udev/rules.d/70-persistent-cd.rules
Line 219... Line 234...
219
 
234
 
220
#
235
#
221
#   Set new machine name
236
#   Set new machine name
222
#
237
#
223
echo $mname > /etc/hostname
238
echo $mname > /etc/hostname
224
sed -i /etc/hosts -e "s~^127\.0\.1\.1.*~127.0.1.1\t$mname~"
239
sed -i /etc/hosts -e "s~^127\.0\.1\.1.*~127.0.1.1\t$mname.vix.local $mname~"
225
hostname -b -F /etc/hostname
240
hostname -b -F /etc/hostname
226
 
241
 
227
#
242
#
228
#   Set the required Mode
243
#   Set the required Mode
229
#
244
#
Line 246... Line 261...
246
fi
261
fi
247
 
262
 
248
#
263
#
249
#   Configure NIS
264
#   Configure NIS
250
#
265
#
-
 
266
echo "Configure NIS"
251
if $perthNis; then
267
if $perthNis; then
252
    echo "Enable yp binding"
268
    echo "Enable yp binding"
253
    rm -f /etc/init/ypbind.override
269
    rm -f /etc/init/ypbind.override
254
    [ -f /etc/defaultdomain.saved ] && mv /etc/defaultdomain.saved /etc/defaultdomain
270
    [ -f /etc/defaultdomain.saved ] && mv /etc/defaultdomain.saved /etc/defaultdomain
255
    start ypbind
271
    start ypbind
Line 279... Line 295...
279
    sed -i /etc/auto.master -e 's~^/home~#/home~'
295
    sed -i /etc/auto.master -e 's~^/home~#/home~'
280
    restart autofs
296
    restart autofs
281
fi
297
fi
282
 
298
 
283
#
299
#
-
 
300
#
284
#   Create local user if need be
301
#   Create local user if need be
-
 
302
#   Note: There is no need to create a local home directory for local users
-
 
303
#         as Ubuntu appears to do this on the fly.
285
#
304
#
-
 
305
echo "Configure Local User"
286
if $addUser; then
306
if $addUser; then
287
    kuser
307
    kuser
288
fi
308
fi
289
if [ -n "$luser" ] ; then
309
if [ -n "$luser" ] ; then
290
    userPath="/home/$luser"
310
    userPath="/home/$luser"
Line 294... Line 314...
294
    fi
314
    fi
295
fi
315
fi
296
 
316
 
297
#
317
#
298
#   Configure the package server
318
#   Configure the package server
299
#       Update the jats.sh for this machine
-
 
300
#       Update the JATS symlink
-
 
301
#
319
#
302
jbin="/usr/local/bin/jats"
320
echo "Configure Package Server"
303
sed -i /etc/profile.d/jats.sh -e "s~^\(GBE_DPKG=/net\)/\([^/]*\)/\(.*\)~\1/$pkgServer/\3~"
321
sed -i /etc/profile.d/jats.sh -e "s~^\(GBE_DPKG=/net\)/\([^/]*\)/\(.*\)~\1/$pkgServer/\3~"
304
if [ -L "$jbin" ] ; then
-
 
305
    newLink=$(readlink "$jbin" | sed -e "s~\(/net\)/\([^/]*\)/\(.*\)~\1/$pkgServer/\3~")
-
 
306
echo $newLink
-
 
307
    rm -f "$jbin"
-
 
308
    ln -s "$newLink" "$jbin"
-
 
309
elif [ ! -e "$jbin" ] ; then
-
 
310
    ln -s /net/$pkgServer/export/devl/core_devl2/TOOLS/jats.sh "$jbin"
-
 
311
fi
-
 
312
 
322
 
313
#
323
#
314
#   Flag - configuration done
324
#   Flag - configuration done
315
#   This should stop the auto script from running again
325
#   This should stop the auto script from running again
316
#
326
#
317
if [ -z "$startupMode" ]; then
327
if [ -z "$startupMode" ]; then
318
    echo "Flag - don't run again"
328
    echo "Flag - don't run again"
319
    mkdir -p /root/.vix
329
    mkdir -p /root/.vix
320
    touch /root/.vix/config
330
    touch /root/.vix/config
321
fi
331
fi
322
if [ $erase -eq 0 ] ; then
332
if [ "$erase" -eq "0" ] ; then
-
 
333
    echo "Erase config details. Force script to run on next reboot"
323
    rm -f /root/.vix/config
334
    rm -f /root/.vix/config
324
fi
335
fi
325
 
336
 
326
 
-
 
327
#
337
#
328
#   Reboot the system
338
#   Reboot the system
329
#   If manually invoked then give the user the option of aborting the boot
339
#   If manually invoked then give the user the option of aborting the boot
330
#
340
#
331
ktype=yesno
341
ktype=yesno
332
[ -z "$startupMode" ] && ktype=msgbox
342
[ -z "$startupMode" ] && ktype=msgbox
333
kdialog --title "$TITLE" --$ktype "The system will now reboot in order for the changes to take effect"
343
kdialog --title "$TITLE" --$ktype "The system will now reboot in order for the changes to take effect"
334
if [ $? -ne 1 ]; then
344
if [ $? -ne 1 ]; then
-
 
345
    echo "Reboot the system"
335
    reboot
346
    reboot
-
 
347
    echo "Reboot failed. Command returned"
336
fi
348
fi
-
 
349
echo "Script complete"
337
 
350