Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
immerda
Puppet Modules
webhosting
Commits
c7f458ad
Commit
c7f458ad
authored
Jul 03, 2019
by
mh
Browse files
fix path
parent
75ecceda
Changes
1
Hide whitespace changes
Inline
Side-by-side
files/update_scripts/auto_update_wordess.rb
View file @
c7f458ad
...
@@ -71,6 +71,7 @@ sender = ARGV.shift || "root@#{Socket.gethostname}"
...
@@ -71,6 +71,7 @@ sender = ARGV.shift || "root@#{Socket.gethostname}"
Dir
[
'/var/www/vhosts/*/scripts/update_wordpress/update_wordpress.dirs'
].
each
do
|
f
|
Dir
[
'/var/www/vhosts/*/scripts/update_wordpress/update_wordpress.dirs'
].
each
do
|
f
|
vhost_options
=
YAML
.
load_file
(
f
)
vhost_options
=
YAML
.
load_file
(
f
)
dir
=
File
.
dirname
(
f
)
dir
=
File
.
dirname
(
f
)
log_dir
=
File
.
expand_path
(
File
.
join
(
File
.
dirname
(
f
),
'../../logs'
))
hosting
=
File
.
basename
(
File
.
dirname
(
File
.
dirname
(
dir
)))
hosting
=
File
.
basename
(
File
.
dirname
(
File
.
dirname
(
dir
)))
if
vhost_options
[
'auto_update'
]
if
vhost_options
[
'auto_update'
]
vhost_options
=
YAML
.
load_file
(
File
.
join
(
File
.
dirname
(
dir
),
'vhost.options'
))
vhost_options
=
YAML
.
load_file
(
File
.
join
(
File
.
dirname
(
dir
),
'vhost.options'
))
...
@@ -85,7 +86,7 @@ Dir['/var/www/vhosts/*/scripts/update_wordpress/update_wordpress.dirs'].each do
...
@@ -85,7 +86,7 @@ Dir['/var/www/vhosts/*/scripts/update_wordpress/update_wordpress.dirs'].each do
File
.
chown
(
uid
,
gid
,
run_file
)
File
.
chown
(
uid
,
gid
,
run_file
)
result
=
`/opt/webhosting_user_scripts/update_wordpress/update_wordpress.rb
#{
run_file
}
2>&1`
result
=
`/opt/webhosting_user_scripts/update_wordpress/update_wordpress.rb
#{
run_file
}
2>&1`
exit_code
=
$?
.
to_i
exit_code
=
$?
.
to_i
File
.
open
(
File
.
join
(
dir
,
'update_wordpress.log'
),
'a'
){
|
f
|
f
<<
result
}
File
.
open
(
File
.
join
(
log_
dir
,
'
users-script-
update_wordpress.log'
),
'a'
){
|
f
|
f
<<
result
}
if
exit_code
>
0
if
exit_code
>
0
error_log
"Error while running update for
#{
hosting
}
- Exitcode:
#{
exit_code
}
-
#{
result
}
"
error_log
"Error while running update for
#{
hosting
}
- Exitcode:
#{
exit_code
}
-
#{
result
}
"
inform_about_error
(
sender
,
vhost_options
[
'hosting_contact'
],
hosting
,
exit_code
,
result
,
uid
,
gid
)
inform_about_error
(
sender
,
vhost_options
[
'hosting_contact'
],
hosting
,
exit_code
,
result
,
uid
,
gid
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment