Added client work scripts
[clearscm.git] / clients / HP / bin / fix_startup
1 #!/bin/ksh
2 ################################################################################
3 #
4 # File:         fixr_startup
5 # Description:  This script will fix the local startup scripts. Thist is done
6 #               by moving them from /sbin/rc2.d to /sbin/rc3.d where they 
7 #               really belong.
8 # Author:       Andrew DeFaria (defaria@cup.hp.com)
9 # Language:     Korn Shell
10 #
11 # (c) Copyright 2001, Andrew@DeFaria.com, all rights reserved
12 #
13 ################################################################################
14 # First source /app/appserver
15 if [ -x /app/appserver ]; then
16   . /app/appserver
17 fi
18
19 if [ $(id -u) -ne 0 ]; then
20   print -u2 "Error: You must be root to execute this command!"
21   exit 1
22 fi
23
24 if [ "$OS" = "09" ]; then
25   print -u2 "Error: $(basename $0) does not run on 9.x!"
26   exit 1
27 fi
28
29 moved_a_file=no
30
31 if [ -x /sbin/rc2.d/S900local ]; then
32   print "Moving /sbin/rc2.d/S900local \-> /sbin/rc3.d/S900local"
33   mv /sbin/rc2.d/S900local /sbin/rc3.d/S900local
34   moved_a_file=yes
35 fi
36
37 if [ -x /sbin/rc2.d/S920start_views ]; then
38   print "Moving /sbin/rc2.d/S920start_views \-> /sbin/rc3.d/S770start_views"
39   mv /sbin/rc2.d/S920start_views /sbin/rc3.d/S770start_views
40   moved_a_file=yes
41 fi
42
43 if [ -x /sbin/rc2.d/S910mount_additional_vobs ]; then
44   print "Moving /sbin/rc2.d/S910mount_additional_vobs \-> /sbin/rc3.d/S775mount_additional_vobs"
45   mv /sbin/rc2.d/S910mount_additional_vobs /sbin/rc3.d/S775mount_additional_vobs
46   moved_a_file=yes
47 fi
48
49 if [ "$moved_a_file" = "no" ]; then
50   print "Startup scripts already in their proper places"
51 else
52   print "Fixed startup scripts"
53 fi