Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
e3-require
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ESS EPICS Environment
wrappers
e3-require
Commits
3dcb8964
Commit
3dcb8964
authored
20 years ago
by
luedeke
Browse files
Options
Downloads
Patches
Plain Diff
change link on bootpc for IOC
parent
a9b65762
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!7
Submodule merge
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
App/scripts/bootlink
+77
-0
77 additions, 0 deletions
App/scripts/bootlink
with
77 additions
and
0 deletions
App/scripts/bootlink
0 → 100755
+
77
−
0
View file @
3dcb8964
#!/bin/sh
if
[
$#
-lt
2
]
||
[
"
$1
"
=
"-?"
]
then
echo
"using:
$0
(<newbase>|-) <IOC> [<IOC2> [...]]"
echo
"change boot path for list of IOCs"
echo
"if <newbase> =
\"
-
\"
it shows the current links"
exit
fi
if
[
"
$1
"
=
"-v"
]
;
then
echo
"
\$
Header: /cvs/G/DRV/misc/App/scripts/bootlink,v 1.1 2005/03/21 11:10:43 luedeke Exp $"
;
exit
;
fi
if
[
-d
/usr/oracle-9.2
]
;
then
export
ORACLE_HOME
=
/usr/oracle-9.2
else
export
ORACLE_HOME
=
/usr/oracle-8.1.7
export
LD_LIBRARY_PATH
=
$ORACLE_HOME
/lib:
$LD_LIBRARY_PATH
fi
targetbase
=
$1
if
[
"
$(
chkslsbase.sh
$targetbase
)
"
=
""
]
&&
[
"
$targetbase
"
!=
"-"
]
then
echo
-ne
"first argument (
\"
$targetbase
\"
) has to be one out of
\n
$SLSBASELIST
\n
"
exit
fi
shift
for
ioc
in
$*
do
list
=
$(
echo
$(
$ORACLE_HOME
/bin/sqlplus
-s
ssrm_public/pub01@psip0
<<
EOF
SET HEADING OFF;
SELECT BOOTPC,SLSBASE FROM SSRM.IOC_LASTBOOTED WHERE SYSTEM = '
$ioc
';
EXIT
EOF
))
if
[
"
$list
"
=
"no rows selected"
]
then
echo
"IOC
$ioc
not in bootinfo DB"
exit
fi
bootpc
=
$(
echo
$list
|awk
'{print $1}'
)
;
slsbase
=
$(
echo
$list
|awk
'{print $2}'
)
;
#echo "BootPC=$bootpc"
if
[
"
$slsbase
"
=
"
$targetbase
"
]
then
echo
"according to bootinfo, IOC
$ioc
already has SLSBASE=
$slsbase
"
echo
"continue anyway"
fi
old
=
$(
ssh
$bootpc
readlink
/ioc/
$ioc
)
if
[
"-"
=
"
$targetbase
"
]
then
old
=
$(
ssh
$bootpc
readlink
/ioc/
$ioc
)
echo
"link on
$bootpc
for
$ioc
is
\"
$old
\"
"
continue
fi
new
=
"
$targetbase
/iocBoot/ioc/
$ioc
"
if
[
"
$old
"
=
"
$new
"
]
then
echo
"no operation: on
$bootpc
\"
/ioc/
$ioc
\"
already points to
\"
$old
\"
"
continue
fi
if
[
-d
"
$new
"
]
then
ssh
$bootpc
rm
-f
/ioc/
$ioc
ssh
$bootpc
ln
-s
$new
/ioc/
$ioc
rep
=
$(
ssh
$bootpc
readlink
/ioc/
$ioc
)
if
[
"
$rep
"
=
"
$new
"
]
then
echo
"changed on
$bootpc
from
\"
$old
\"
to
\"
$new
\"
"
else
echo
"ERROR: change on
$bootpc
from
\"
$old
\"
to
\"
$new
\"
failed"
echo
"link points now to
\"
$req
\"
. Check permissions:"
ssh
$bootpc
ls
-l
/ioc/
$ioc
fi
else
echo
"target dir
\"
$tdir
\"
does not exist"
continue
fi
done
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment