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
1c4beed6
Commit
1c4beed6
authored
13 years ago
by
Tomáš Plesník
Browse files
Options
Downloads
Patches
Plain Diff
revize kodu; zmena pristupovych prav k SSL certifikatu a klici
parent
8617734a
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/warden-client/sh/install.sh
+13
-11
13 additions, 11 deletions
src/warden-client/sh/install.sh
src/warden-client/sh/uninstall.sh
+5
-5
5 additions, 5 deletions
src/warden-client/sh/uninstall.sh
src/warden-client/sh/update.sh
+12
-8
12 additions, 8 deletions
src/warden-client/sh/update.sh
with
30 additions
and
24 deletions
src/warden-client/sh/install.sh
+
13
−
11
View file @
1c4beed6
...
...
@@ -183,7 +183,7 @@ modules_chck()
make_warden_dir
()
{
echo
-n
"Creating warden client directory ... "
if
cp
-R
$dirname
/warden-client
$prefix
2>
$err
;
then
if
cp
-R
$
{
dirname
}
/warden-client
$prefix
2>
$err
;
then
echo
"OK"
else
err_clean
...
...
@@ -192,9 +192,9 @@ make_warden_dir()
files
=(
CHANGELOG INSTALL LICENSE README README.cesnet
)
for
file
in
${
files
[@]
}
;
do
cp
$dirname
/
$file
"
$client_path
/doc"
cp
$
{
dirname
}
/
$file
"
$
{
client_path
}
/doc"
done
cp
$dirname
/uninstall.sh
"
$client_path
"
cp
$
{
dirname
}
/uninstall.sh
"
$client_path
"
}
...
...
@@ -235,17 +235,17 @@ make_conf_file()
#-------------------------------------------------------------------------------
# SSL_KEY_FILE - path to client SSL certificate key file
#-------------------------------------------------------------------------------
\$
SSL_KEY_FILE =
\"
$etc
/
$key_file
\"
;
\$
SSL_KEY_FILE =
\"
$
{
etc
}
/
$
{
key_file
}
\"
;
#-------------------------------------------------------------------------------
# SSL_CERT_FILE - path to client SSL certificate file
#-------------------------------------------------------------------------------
\$
SSL_CERT_FILE =
\"
$etc
/
$cert_file
\"
;
\$
SSL_CERT_FILE =
\"
$
{
etc
}
/
$
{
cert_file
}
\"
;
#-------------------------------------------------------------------------------
# SSL_CA_FILE - path to CA certificate file
#-------------------------------------------------------------------------------
\$
SSL_CA_FILE =
\"
$ca_file
\"
;
\$
SSL_CA_FILE =
\"
$
{
ca_file
}
\"
;
"
>
$conf_file
2>
$err
;
ret_val
=
`
echo
$?
`
if
[
$ret_val
-eq
0
]
;
then
...
...
@@ -259,7 +259,9 @@ make_conf_file()
change_permissions
()
{
echo
-n
"Changing permissions to installed package ... "
if
chown
-R
$user
:
$client_path
2>
$err
;
then
chown
-R
$user
:
$client_path
2>
$err
||
err_clean
chmod
400
${
etc
}
/
$key_file
${
etc
}
/
$cert_file
||
err_clean
if
chmod
600
$conf_file
;
then
echo
"OK"
else
err_clean
...
...
@@ -303,13 +305,13 @@ params_chck
# create variables
dirname
=
`
dirname
$0
`
package_version
=
`
cat
$dirname
/warden-client/etc/package_version
`
package_version
=
`
cat
$
{
dirname
}
/warden-client/etc/package_version
`
key_file
=
`
basename
$key
`
cert_file
=
`
basename
$cert
`
[[
$prefix
==
*
/
]]
&&
prefix
=
"
${
prefix
%?
}
"
# remove last char (slash) from prefix
client_path
=
"
$prefix
/warden-client"
etc
=
"
$client_path
/etc"
conf_file
=
"
$etc
/warden-client.conf"
client_path
=
"
$
{
prefix
}
/warden-client"
etc
=
"
$
{
client_path
}
/etc"
conf_file
=
"
$
{
etc
}
/warden-client.conf"
err
=
"/tmp/warden-err"
# check if warden-client is installed
...
...
This diff is collapsed.
Click to expand it.
src/warden-client/sh/uninstall.sh
+
5
−
5
View file @
1c4beed6
...
...
@@ -74,8 +74,8 @@ err_clean()
{
echo
"FAILED!"
echo
" -> Reverting changes of warden client package ... OK"
rm
-rf
"
$client_path
/*
"
>
/dev/null 2>&1
cp
-R
"
$backup_dir
/*
"
$client_path
rm
-rf
$
{
client_path
}
/
*
>
/dev/null 2>&1
cp
-R
$
{
backup_dir
}
/
*
$client_path
cat
$err
rm
-rf
$err
$backup_dir
echo
...
...
@@ -195,9 +195,9 @@ params_chck
# create variables
[[
$prefix
==
*
/
]]
&&
prefix
=
"
${
prefix
%?
}
"
# remove last char (slash) from prefix
client_path
=
"
$prefix
/warden-client"
etc
=
"
$client_path
/etc"
old_package_version_file
=
"
$etc
/package_version"
client_path
=
"
$
{
prefix
}
/warden-client"
etc
=
"
$
{
client_path
}
/etc"
old_package_version_file
=
"
$
{
etc
}
/package_version"
err
=
"/tmp/warden-err"
backup_dir
=
"/tmp/warden-backup"
...
...
This diff is collapsed.
Click to expand it.
src/warden-client/sh/update.sh
+
12
−
8
View file @
1c4beed6
...
...
@@ -76,8 +76,8 @@ err_clean()
{
echo
"FAILED!"
echo
" -> Reverting changes of warden client package ... OK"
rm
-rf
"
$client_path
/*
"
>
/dev/null 2>&1
cp
-R
"
$backup_dir
/*
"
$client_path
rm
-rf
$
{
client_path
}
/
*
>
/dev/null 2>&1
cp
-R
$
{
backup_dir
}
/
*
$client_path
cat
$err
rm
-rf
$err
$backup_dir
echo
...
...
@@ -206,7 +206,7 @@ obtain_warden_user()
update_warden_dir
()
{
echo
-n
"Updating warden client directory ... "
if
rsync
-q
--recursive
--archive
--delete
--exclude
=
'etc'
--exclude
=
'var'
"
$dirname
/warden-client
"
$prefix
2>
$err
;
then
if
rsync
-q
--recursive
--archive
--delete
--exclude
=
'etc'
--exclude
=
'var'
$
{
dirname
}
/warden-client
$prefix
2>
$err
;
then
echo
"OK"
else
err_clean
...
...
@@ -215,10 +215,10 @@ update_warden_dir()
files
=(
CHANGELOG INSTALL LICENSE README README.cesnet
)
for
file
in
${
files
[@]
}
;
do
cp
"
$dirname
/
$file
"
"
$
client_path
/doc
"
cp
$
{
dirname
}
/
$file
${
client_path
}
/doc
done
cp
"
$dirname
/uninstall.sh
"
"
$client_path
"
cp
"
$dirname
/warden-client/etc/package_version
"
"
$etc
"
cp
$
{
dirname
}
/uninstall.sh
$client_path
cp
$
{
dirname
}
/warden-client/etc/package_version
$etc
}
...
...
@@ -265,11 +265,15 @@ $ssl_ca_file
change_permissions
()
{
echo
-n
"Changing permissions to updated package ... "
if
chown
-R
$user
:
$client_path
2>
$err
;
then
chown
-R
$user
:
$client_path
2>
$err
||
err_clean
key_file
=
`
echo
$ssl_key_file
`
|
cut
-d
"
\"
"
-f
2 |
cut
-d
"
\"
"
-f
1
cert_file
=
`
echo
$ssl_cert_file
`
|
cut
-d
"
\"
"
-f
2 |
cut
-d
"
\"
"
-f
1
chmod
400
${
etc
}
/
$key_file
${
etc
}
/
$cert_file
||
err_clean
if
chmod
600
$conf_file
;
then
echo
"OK"
else
err_clean
fi
fi
}
...
...
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