Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Warden
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pavel Valach
Warden
Commits
4ffb9ec5
Commit
4ffb9ec5
authored
13 years ago
by
Tomáš Plesník
Browse files
Options
Downloads
Patches
Plain Diff
odinstalacni skript warden serveru
parent
f9d02dea
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/warden-server/sh/uninstall.sh
+31
-16
31 additions, 16 deletions
src/warden-server/sh/uninstall.sh
with
31 additions
and
16 deletions
src/warden-server/sh/uninstall.sh
+
31
−
16
View file @
4ffb9ec5
...
@@ -73,9 +73,11 @@ err()
...
@@ -73,9 +73,11 @@ err()
err_clean
()
err_clean
()
{
{
echo
"FAILED!"
echo
"FAILED!"
echo
" -> Reverting changes of warden client package ... OK"
echo
" -> Reverting changes of warden server package ... OK"
rm
-rf
"
$client_path
/*"
>
/dev/null 2>&1
rm
-rf
"
$server_path
/*"
>
/dev/null 2>&1
cp
-R
"
$backup_dir
/*"
$client_path
cp
-R
"
$backup_dir
/*"
$server_path
ln
-s
$server_path
/bin/wardend
$init
$init
start
cat
$err
cat
$err
rm
-rf
$err
$backup_dir
rm
-rf
$err
$backup_dir
echo
echo
...
@@ -134,22 +136,31 @@ obtain_package_version()
...
@@ -134,22 +136,31 @@ obtain_package_version()
warden_dir_chck
()
warden_dir_chck
()
{
{
echo
-n
"Checking warden
client
directory ... "
echo
-n
"Checking warden
server
directory ... "
if
[
!
-d
$
client
_path
]
;
then
if
[
!
-d
$
server
_path
]
;
then
echo
"FAILED!"
echo
"FAILED!"
ls
$
client
_path
ls
$
server
_path
exit
1
exit
1
else
else
echo
"OK"
echo
"OK"
fi
fi
}
}
stop_warden_server
()
{
$init
stop
ret_val
=
`
$init
status |
grep
NOT
;
echo
$?
`
if
[
$ret_val
-ne
0]
;
then
$init
force-stop
fi
}
backup
()
backup
()
{
{
echo
-n
"Backing-up warden
client
directory ... "
echo
-n
"Backing-up warden
server
directory ... "
mkdir
$backup_dir
mkdir
$backup_dir
cp
-R
$
client
_path
$backup_dir
2>
$err
;
ret_val
=
`
echo
$?
`
cp
-R
$
server
_path
$backup_dir
2>
$err
;
ret_val
=
`
echo
$?
`
if
[
$ret_val
-eq
0
]
;
then
if
[
$ret_val
-eq
0
]
;
then
echo
"OK"
echo
"OK"
else
else
...
@@ -158,10 +169,10 @@ backup()
...
@@ -158,10 +169,10 @@ backup()
}
}
uninstall_warden_
client
()
uninstall_warden_
server
()
{
{
echo
-n
"Uninstalling
$package_version
package ... "
echo
-n
"Uninstalling
$package_version
package ... "
rm
-rf
$
client
_path
2>
$err
;
ret_val
=
`
echo
$?
`
rm
-rf
$
server
_path
2>
$err
;
ret_val
=
`
echo
$?
`
if
[
$ret_val
-eq
0
]
;
then
if
[
$ret_val
-eq
0
]
;
then
echo
"OK"
echo
"OK"
else
else
...
@@ -197,26 +208,30 @@ params_chck
...
@@ -197,26 +208,30 @@ params_chck
# create variables
# create variables
[[
$prefix
==
*
/
]]
&&
prefix
=
"
${
prefix
%?
}
"
# remove last char (slash) from prefix
[[
$prefix
==
*
/
]]
&&
prefix
=
"
${
prefix
%?
}
"
# remove last char (slash) from prefix
client
_path
=
"
$prefix
/warden-
client
"
server
_path
=
"
$prefix
/warden-
server
"
etc
=
"
$
client
_path
/etc"
etc
=
"
$
server
_path
/etc"
old_package_version_file
=
"
$etc
/package_version"
old_package_version_file
=
"
$etc
/package_version"
err
=
"/tmp/warden-err"
err
=
"/tmp/warden-err"
backup_dir
=
"/tmp/warden-backup"
backup_dir
=
"/tmp/warden-backup"
init
=
"/etc/init.d/warden"
# obtain version of installed warden-
client
package
# obtain version of installed warden-
server
package
obtain_package_version
obtain_package_version
echo
echo
echo
"------------------------- Uninstallation process --------------------------------"
echo
"------------------------- Uninstallation process --------------------------------"
# check if $prefix/warden-
client
directory exist
# check if $prefix/warden-
server
directory exist
warden_dir_chck
warden_dir_chck
# make backup of currently installed warden-client package
# stop running warden server
stop_warden_server
# make backup of currently installed warden-server package
backup
backup
# do uninstallation
# do uninstallation
uninstall_warden_
client
uninstall_warden_
server
echo
echo
echo
"Uninstallation of
$package_version
package was SUCCESSFUL!!!"
echo
"Uninstallation of
$package_version
package was SUCCESSFUL!!!"
...
...
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