Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Warden - archive
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
713
Warden
Warden - archive
Commits
5af60377
Commit
5af60377
authored
Feb 1, 2012
by
Tomáš Plesník
Browse files
Options
Downloads
Patches
Plain Diff
zmena verze skriptu; pridano zjistovani verze klienta urceneho k updatu; zmena odsazeni
parent
1b980a3c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/warden-client/sh/update.sh
+159
-141
159 additions, 141 deletions
src/warden-client/sh/update.sh
with
159 additions
and
141 deletions
src/warden-client/sh/update.sh
+
159
−
141
View file @
5af60377
...
...
@@ -67,7 +67,7 @@ err()
rm
-rf
$err
rm
-rf
$backup_dir
echo
echo
"Update to
$package_name
package FAILED!!!"
echo
"Update
from
$old_package_name
to
$package_name
package FAILED!!!"
exit
1
}
...
...
@@ -79,10 +79,9 @@ err_clean()
rm
-rf
"
$client_path
/*"
>
/dev/null 2>&1
cp
-R
"
$backup_dir
/*"
$client_path
cat
$err
rm
-rf
$err
rm
-rf
$backup_dir
rm
-rf
$err
$backup_dir
echo
echo
"Update to
$package_name
package FAILED!!!"
echo
"Update
from
$old_package_name
to
$package_name
package FAILED!!!"
exit
1
}
...
...
@@ -125,6 +124,18 @@ params_chck()
}
obtain_package_version
()
{
if
[
-f
$old_package_version_file
]
;
then
old_package_version
=
`
cat
$old_package_version_file
`
else
echo
"Sorry, but warden-client package is not installed!"
echo
"For installation of warden client package please use install.sh script."
exit
1
fi
}
perl_chck
()
{
echo
-n
"Checking Perl interpreter ... "
...
...
@@ -208,7 +219,10 @@ obtain_warden_user()
update_warden_dir
()
{
echo
-n
"Updating warden client directory ... "
rsync
-q
--recursive
--archive
--delete
--exclude
=
"warden-client/etc"
--exclude
=
"warden-client/var"
warden-client
$prefix
2>
$err
;
ret_val
=
`
echo
$?
`
rsync
-q
--recursive
--archive
--delete
--exclude
=
"
$dirname
/warden-client/etc"
\
--include
=
"
$dirname
/warden-client/etc/package_version.txt"
\
--exclude
=
"
$dirname
/warden-client/var"
\
warden-client
$prefix
2>
$err
;
ret_val
=
`
echo
$?
`
if
[
$ret_val
-eq
0
]
;
then
echo
"OK"
else
...
...
@@ -218,9 +232,9 @@ update_warden_dir()
files
=(
CHANGELOG INSTALL LICENSE README README.cesnet
)
for
file
in
${
files
[@]
}
;
do
cp
-u
"
`
dirname
$0
`
/
$file
"
"
$client_path
/doc"
cp
-u
"
$
dirname
/
$file
"
"
$client_path
/doc"
done
cp
-u
"
`
dirname
$0
`
/uninstall.sh"
"
$client_path
"
cp
-u
"
$
dirname
/uninstall.sh"
"
$client_path
"
}
...
...
@@ -255,6 +269,7 @@ $ssl_cert_file
#-------------------------------------------------------------------------------
$ssl_ca_file
"
>
$conf_file
2>
$err
;
ret_val
=
`
echo
$?
`
if
[
$ret_val
-eq
0
]
;
then
echo
"OK"
else
...
...
@@ -306,13 +321,18 @@ root_chck
params_chck
# create variables
package_name
=
"warden-client-
$VERSION
"
dirname
=
`
dirname
$0
`
package_version
=
`
cat
$dirname
/warden-client/etc/package_version.txt
`
client_path
=
"
$prefix
/warden-client"
etc
=
"
$client_path
/etc"
old_package_version_file
=
"
$etc
/package_version.txt"
conf_file
=
"
$etc
/warden-client.conf"
err
=
"/tmp/warden-err"
backup_dir
=
"/tmp/warden-backup"
# obtain version of old warden client
#obtain_package_version # ENABLE for next client package
old_package_version
=
"1.0.0"
echo
echo
"------------------------- Dependencies check-in -------------------------"
...
...
@@ -323,7 +343,6 @@ perl_chck
# Perl modules test
modules_chck
echo
echo
"------------------------- Update process --------------------------------"
...
...
@@ -351,10 +370,9 @@ change_permissions
echo
echo
"Please check configuration file in
$conf_file
!"
echo
echo
"Update
to
$package_name
package was SUCCESSFUL!!!"
echo
"Update
from
$old_package_version
to
$package_version
package was SUCCESSFUL!!!"
# cleanup section
rm
-rf
$err
rm
-rf
$backup_dir
rm
-rf
$err
$backup_dir
exit
0
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