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
1ac16a3e
"src/mol-plugin/git@gitlab.cesnet.cz:madcatxster/molstar.git" did not exist on "0e0529d35e4e3da545fb022f15a724e68d1498db"
Commit
1ac16a3e
authored
13 years ago
by
Tomáš Plesník
Browse files
Options
Downloads
Patches
Plain Diff
instalacni skript serveru
parent
1da619e3
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/install.sh
+135
-65
135 additions, 65 deletions
src/warden-server/sh/install.sh
with
135 additions
and
65 deletions
src/warden-server/sh/install.sh
+
135
−
65
View file @
1ac16a3e
...
...
@@ -121,10 +121,6 @@ params_chck()
prefix
=
/opt
echo
"Warning: parameter -d <directory> is not set - default installation directory is
$prefix
!"
fi
if
[
-z
$user
]
;
then
echo
"Parameter -u <user> is not set!"
exit
1
fi
if
[
-z
$key
]
;
then
echo
"Parameter -k <ssl_key_file> is not set!"
exit
1
...
...
@@ -140,13 +136,13 @@ params_chck()
}
old_
client
_chck
()
old_
package
_chck
()
{
old_package_version_file
=
"
$etc
/package_version"
if
[
-f
$old_package_version_file
]
;
then
old_package_version
=
`
cat
$old_package_version_file
`
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
server
package please use update.sh"
exit
1
fi
}
...
...
@@ -155,8 +151,7 @@ old_client_chck()
perl_chck
()
{
echo
-n
"Checking Perl interpreter ... "
which perl 1>/dev/null
;
ret_val
=
`
echo
$?
`
if
[
$ret_val
-eq
0
]
;
then
if
which perl 1> /dev/null
;
then
echo
"OK"
else
echo
"FAILED!"
...
...
@@ -165,14 +160,24 @@ perl_chck()
fi
}
sqlite_chck
()
{
echo
-n
"Checking SQLite database engine ... "
if
which sqlite3 1> /dev/null
;
then
echo
"OK"
else
echo
"FAILED!"
echo
"Error: SQLite3 database engine is not installed!"
exit
1
fi
}
modules_chck
()
{
for
module
in
${
modules
[@]
}
;
do
echo
-n
"Checking
$module
module ... "
perl
-e
"use
$module
"
2>
$err
;
ret_val
=
`
echo
$?
`
if
[
$ret_val
-eq
0
]
;
then
if
perl
-e
"use
$module
"
2>
$err
;
then
echo
"OK"
else
err
...
...
@@ -183,39 +188,50 @@ modules_chck()
make_warden_dir
()
{
echo
-n
"Creating warden client directory ... "
cp
-R
$dirname
/warden-client
$prefix
2>
$err
;
ret_val
=
`
echo
$?
`
if
[
$ret_val
-eq
0
]
;
then
echo
-n
"Creating warden server directory ... "
if
cp
-R
$dirname
/warden-server
$prefix
2>
$err
;
then
echo
"OK"
else
err_clean
fi
files
=(
CHANGELOG INSTALL LICENSE README
README.cesnet
)
files
=(
CHANGELOG INSTALL LICENSE README
)
for
file
in
${
files
[@]
}
;
do
cp
$dirname
/
$file
"
$client
_path
/doc
"
cp
$dirname
/
$file
$server
_path
/doc
done
cp
$dirname
/uninstall.sh
"
$client
_path
"
cp
$dirname
/uninstall.sh
$server
_path
}
copy_key
()
make_client_conf
()
{
echo
-n
"Copying certificate key file ... "
cp
$key
$etc
2>
$err
;
ret_val
=
`
echo
$?
`
if
[
$ret_val
-eq
0
]
;
then
echo
"OK"
else
err_clean
fi
}
echo
-n
"Creating client configuration file ... "
echo
"#
# warden-client.conf - configuration file for the warden sender/receiver client
#
#-------------------------------------------------------------------------------
# URI - URI address of Warden server
#-------------------------------------------------------------------------------
\$
URI =
\"
https://
${
hostname
}
:443/Warden
\"
;
#-------------------------------------------------------------------------------
# SSL_KEY_FILE - path to client SSL certificate key file
#-------------------------------------------------------------------------------
\$
SSL_KEY_FILE =
\"
${
etc
}
/
${
key_file
}
\"
;
#-------------------------------------------------------------------------------
# SSL_CERT_FILE - path to client SSL certificate file
#-------------------------------------------------------------------------------
\$
SSL_CERT_FILE =
\"
${
etc
}
/
${
cert_file
}
\"
;
#-------------------------------------------------------------------------------
# SSL_CA_FILE - path to CA certificate file
#-------------------------------------------------------------------------------
\$
SSL_CA_FILE =
\"
${
ca_file
}
\"
;
"
>
$client_conf
2>
$err
;
ret_val
=
`
echo
$?
`
copy_cert
()
{
echo
-n
"Copying certificate file ... "
cp
$cert
$etc
2>
$err
;
ret_val
=
`
echo
$?
`
if
[
$ret_val
-eq
0
]
;
then
echo
"OK"
else
...
...
@@ -224,33 +240,63 @@ copy_cert()
}
make_
conf_file
()
make_
server_conf
()
{
echo
-n
"Creating configuration file ... "
echo
"#
# warden-
client
.conf - configuration file for
the w
arden se
nder/receiver client
echo
-n
"Creating
server
configuration file ... "
echo
"#
# warden-
server
.conf - configuration file for
W
arden se
rver
#
#-------------------------------------------------------------------------------
#
URI - URI
address of
W
arden server
#
ADDRESS - IP
address of
w
arden server
#-------------------------------------------------------------------------------
\$
URI =
\"
https://warden.cesnet.cz:443/Warden
\"
;
\$
ADDRESS =
\"
${
hostname
}
\"
;
#-------------------------------------------------------------------------------
#
SSL_KEY_FILE - path to client SSL certificate key file
#
PORT - used TCP port for Warden server
#-------------------------------------------------------------------------------
\$
SSL_KEY_FILE =
\"
$etc
/
$key_file
\"
;
\$
PORT =
\"
443
\"
;
#-------------------------------------------------------------------------------
#
SSL_CERT_FILE - path to client SSL certificate file
#
BASEDIR - base directory of Warden server
#-------------------------------------------------------------------------------
\$
SSL_CERT_FILE =
\"
$etc
/
$cert_file
\"
;
\$
BASEDIR =
\"
${
server_path
}
\"
;
#-------------------------------------------------------------------------------
# SSL_CA_FILE - path to CA certificate file
# VARDIR - var directory
#-------------------------------------------------------------------------------
\$
VARDIR =
\"\$
BASEDIR/var/
\"
;
#-------------------------------------------------------------------------------
# LOGDIR - logging directory
#-------------------------------------------------------------------------------
\$
LOGDIR =
\"
/var/log/
\"
;
#-------------------------------------------------------------------------------
# PIDDIR - process ID directory
#-------------------------------------------------------------------------------
\$
PIDDIR =
\"
/var/run/
\"
;
#-------------------------------------------------------------------------------
# SSL_KEY_FILE - path to server SSL certificate key file
#-------------------------------------------------------------------------------
\$
SSL_KEY_FILE =
\"
${
key
}
\"
;
#-------------------------------------------------------------------------------
# SSL_CERT_FILE - path to server SSL certificate file
#-------------------------------------------------------------------------------
\$
SSL_CERT_FILE =
\"
${
cert
}
\"
;
#-------------------------------------------------------------------------------
# SSL_CA_FILE - path to CA ceritificate file
#-------------------------------------------------------------------------------
\$
SSL_CA_FILE =
\"
$ca_file
\"
;
"
>
$conf_file
2>
$err
;
ret_val
=
`
echo
$?
`
\$
SSL_CA_FILE =
\"
${
ca_file
}
\"
;
#-------------------------------------------------------------------------------
# FACILITY - syslog facility
#-------------------------------------------------------------------------------
\$
FACILITY =
\"
local7
\"
;
"
>
$server_conf
2>
$err
;
ret_val
=
`
echo
$?
`
if
[
$ret_val
-eq
0
]
;
then
echo
"OK"
...
...
@@ -260,11 +306,11 @@ make_conf_file()
}
c
hange_permissions
()
c
reate_db
()
{
echo
-n
"C
hanging permissions to installed packag
e ... "
chown
-R
$user
:
$client_path
2>
$err
;
ret_val
=
`
echo
$?
`
if
[
$ret_val
-eq
0
]
;
then
echo
-n
"C
reating warden server databas
e ... "
$create_tables
$db_file
2>
$err
||
err_clean
if
chmod
600
$db_file
2>
$err
;
then
echo
"OK"
else
err_clean
...
...
@@ -272,13 +318,24 @@ change_permissions()
}
create_symlinks
()
{
echo
"Creating symbolic links ..."
for
file
in
`
ls
-1
$bin
|
grep
-v
warden-alive |
grep
-v
create_tables.sh |
grep
-v
wardend
`
do
echo
"- making symlink:
${
local_bin
}
/
$file
->
${
bin
}
/
$file
"
ln
-s
${
bin
}
/
$file
${
local_bin
}
/
$file
done
echo
"- making symlink:
${
bin
}
/wardend ->
$init
"
ln
-s
${
bin
}
/wardend
$init
}
#-------------------------------------------------------------------------------
# MAIN
#-------------------------------------------------------------------------------
# list of used Perl modules
modules
=(
SOAP::Lite
IO::Socket::SSL
SOAP::Transport::TCP Fi
ndBin DateTime
)
modules
=(
SOAP::Lite SOAP::Transport::TCP Fi
le::Pid POSIX DBI DBD::SQLite Format::Human::Bytes Sys::Syslog File::Basename FindBin Net::CIDR::Lite DateTime Getopt::Std Switch IO::Socket::SSL
)
# OS test
os_chck
...
...
@@ -287,10 +344,9 @@ os_chck
shell_chck
# read input
while
getopts
"d:
u:
k:c:a:Vh"
options
;
do
while
getopts
"d:k:c:a:Vh"
options
;
do
case
$options
in
d
)
prefix
=
$OPTARG
;;
u
)
user
=
$OPTARG
;;
k
)
key
=
$OPTARG
;;
c
)
cert
=
$OPTARG
;;
a
)
ca_file
=
$OPTARG
;;
...
...
@@ -308,17 +364,26 @@ params_chck
# create variables
dirname
=
`
dirname
$0
`
package_version
=
`
cat
$dirname
/warden-client/etc/package_version
`
hostname
=
`
hostname
`
key_file
=
`
basename
$key
`
cert_file
=
`
basename
$cert
`
package_version
=
`
cat
${
dirname
}
/warden-server/etc/package_version
`
create_tables
=
"
${
dirname
}
/warden-server/bin/create_tables.sh"
[[
$prefix
==
*
/
]]
&&
prefix
=
"
${
prefix
%?
}
"
# remove last char (slash) from prefix
client_path
=
"
$prefix
/warden-client"
etc
=
"
$client_path
/etc"
conf_file
=
"
$etc
/warden-client.conf"
server_path
=
"
${
prefix
}
/warden-server"
bin
=
"
${
server_path
}
/bin"
local_bin
=
"/usr/local/bin"
etc
=
"
${
server_path
}
/etc"
client_conf
=
"
${
etc
}
/warden-client.conf"
server_conf
=
"
${
etc
}
/warden-server.conf"
var
=
"
${
server_path
}
/var"
db_file
=
"
${
var
}
/warden.db"
err
=
"/tmp/warden-err"
init
=
"/etc/init.d/wardend"
# check if warden-
client
is installed
old_
client
_chck
# check if warden-
server
is installed
old_
package
_chck
echo
echo
"------------------------- Dependencies check-in -------------------------"
...
...
@@ -326,30 +391,35 @@ echo "------------------------- Dependencies check-in -------------------------"
# Perl interpreter test
perl_chck
# SQLite database engine test
sqlite_chck
# Perl modules test
modules_chck
echo
echo
"------------------------- Installation process --------------------------"
# make warden client directory
make_warden_dir
# c
opy cert key
file
copy_key
# c
reate client configuration
file
make_client_conf
# c
opy cert
file
copy_cert
# c
reate server configuration
file
make_server_conf
# create
conf fil
e
make_conf_file
# create
warden server databas
e
create_db
# c
hange permissions
c
hange_permission
s
# c
rate symlinks from warden server bin directory to /usr/local/bin
c
reate_symlink
s
echo
echo
"Please check configuration file in
$conf_file
!"
echo
"Please check client configuration file in
$client_conf
!"
echo
"Please check server configuration file in
$server_conf
!"
echo
echo
"Start Warden server by /etc/init.d/wardend start"
echo
echo
"Installation 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