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
6c7b2f54
Commit
6c7b2f54
authored
13 years ago
by
Tomáš Plesník
Browse files
Options
Downloads
Patches
Plain Diff
vytvoreni funkci; uprava nazvu promennych
parent
5af60377
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/warden-client/sh/install.sh
+2
-2
2 additions, 2 deletions
src/warden-client/sh/install.sh
src/warden-client/sh/uninstall.sh
+17
-14
17 additions, 14 deletions
src/warden-client/sh/uninstall.sh
with
19 additions
and
16 deletions
src/warden-client/sh/install.sh
+
2
−
2
View file @
6c7b2f54
...
@@ -143,8 +143,8 @@ params_chck()
...
@@ -143,8 +143,8 @@ params_chck()
old_client_chck
()
old_client_chck
()
{
{
old_package_version
=
"
$etc
/package_version.txt"
old_package_version
_file
=
"
$etc
/package_version.txt"
if
[
-f
$old_package_version
]
;
then
if
[
-f
$old_package_version
_file
]
;
then
echo
"Sorry, but
$old_package_version
package is installed!"
echo
"Sorry, but
$old_package_version
package is installed!"
echo
"For update of warden client package please use update.sh script."
echo
"For update of warden client package please use update.sh script."
exit
1
exit
1
...
...
This diff is collapsed.
Click to expand it.
src/warden-client/sh/uninstall.sh
+
17
−
14
View file @
6c7b2f54
...
@@ -63,8 +63,7 @@ err()
...
@@ -63,8 +63,7 @@ err()
{
{
echo
"FAILED!"
echo
"FAILED!"
cat
$err
cat
$err
rm
-rf
$err
rm
-rf
$err
$backup_dir
rm
-rf
$backup_dir
echo
echo
echo
"Uninstallation of
$package_version
package FAILED!!!"
echo
"Uninstallation of
$package_version
package FAILED!!!"
exit
1
exit
1
...
@@ -78,8 +77,7 @@ err_clean()
...
@@ -78,8 +77,7 @@ err_clean()
rm
-rf
"
$client_path
/*"
>
/dev/null 2>&1
rm
-rf
"
$client_path
/*"
>
/dev/null 2>&1
cp
-R
"
$backup_dir
/*"
$client_path
cp
-R
"
$backup_dir
/*"
$client_path
cat
$err
cat
$err
rm
-rf
$err
rm
-rf
$err
$backup_dir
rm
-rf
$backup_dir
echo
echo
echo
"Uninstallation of
$package_version
package FAILED!!!"
echo
"Uninstallation of
$package_version
package FAILED!!!"
exit
1
exit
1
...
@@ -124,6 +122,16 @@ params_chck()
...
@@ -124,6 +122,16 @@ params_chck()
}
}
obtain_package_version
()
{
if
[
-f
$old_package_version_file
]
;
then
package_version
=
`
cat
$old_package_version_file
`
else
package_version
=
"unknown"
fi
}
uninstallation_dir_chck
()
uninstallation_dir_chck
()
{
{
echo
-n
"Checking uninstallation directory ... "
echo
-n
"Checking uninstallation directory ... "
...
@@ -160,7 +168,7 @@ backup()
...
@@ -160,7 +168,7 @@ backup()
fi
fi
}
}
uninstall_warden
-
client
()
uninstall_warden
_
client
()
{
{
echo
-n
"Uninstalling
$package_version
package ... "
echo
-n
"Uninstalling
$package_version
package ... "
rm
-rf
$client_path
2>
$err
;
ret_val
=
`
echo
$?
`
rm
-rf
$client_path
2>
$err
;
ret_val
=
`
echo
$?
`
...
@@ -200,16 +208,12 @@ params_chck
...
@@ -200,16 +208,12 @@ params_chck
# create variables
# create variables
client_path
=
"
$prefix
/warden-client"
client_path
=
"
$prefix
/warden-client"
etc
=
"
$client_path
/etc"
etc
=
"
$client_path
/etc"
old_package_version_file
=
"
$etc
/package_version.txt"
err
=
"/tmp/warden-err"
err
=
"/tmp/warden-err"
backup_dir
=
"/tmp/warden-backup"
backup_dir
=
"/tmp/warden-backup"
# obtain version of installed warden-client package
# obtain version of installed warden-client package
old_package_version
=
"
$etc
/package_verion.txt"
obtain_package_version
if
[
-f
$old_package_version
]
;
then
package_version
=
`
cat
$etc
/package_version.txt
`
else
package_version
=
"unknown"
fi
echo
echo
echo
"------------------------- Uninstallation process --------------------------------"
echo
"------------------------- Uninstallation process --------------------------------"
...
@@ -224,13 +228,12 @@ warden_dir_chck
...
@@ -224,13 +228,12 @@ warden_dir_chck
backup
backup
# do uninstallation
# do uninstallation
uninstall_warden
-
client
uninstall_warden
_
client
echo
echo
echo
"Uninstallation of
$package_version
package was SUCCESSFUL!!!"
echo
"Uninstallation of
$package_version
package was SUCCESSFUL!!!"
# cleanup section
# cleanup section
rm
-rf
$err
rm
-rf
$err
$backup_dir
rm
-rf
$backup_dir
exit
0
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