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
451aec94
Commit
451aec94
authored
Jun 20, 2019
by
mh
Browse files
make the script reporting it's success
parent
530067ba
Changes
5
Hide whitespace changes
Inline
Side-by-side
files/user_scripts/adjust_permissions/adjust_permissions.rb
View file @
451aec94
...
...
@@ -31,6 +31,7 @@ def run_script
directories
[
'only_webreadable'
].
each
{
|
path
|
adjust
(
path
,
'u+rwX,g-w,o-rwx'
)
}
directories
[
'web_writable'
].
each
{
|
path
|
adjust
(
path
,
'u+rwX,g+rwX,o-rwx'
)
}
log
"Finished adjusting permissions"
return
true
end
## script specific methods
...
...
files/user_scripts/common/webscripts.rb
View file @
451aec94
...
...
@@ -183,6 +183,7 @@ ensure
tf
.
unlink
end
success
=
true
begin
@run_file
=
ARGV
.
shift
usage
if
@run_file
.
nil?
||
!
File
.
exists?
(
@run_file
=
File
.
expand_path
(
@run_file
))
...
...
@@ -210,10 +211,13 @@ begin
end
File
.
open
(
lockfile
,
'w'
){
|
f
|
f
<<
$$
}
run_script
success
=
run_script
rescue
=>
e
log
"Error while running script:
#{
e
.
message
}
"
success
=
false
ensure
File
.
delete
(
@run_file
)
if
File
.
exists?
(
@run_file
)
File
.
delete
(
lockfile
)
end
exit
success
?
0
:
1
files/user_scripts/ssh_authorized_keys/ssh_authorized_keys.rb
View file @
451aec94
...
...
@@ -47,6 +47,7 @@ def run_script
end
log
"Wrote
#{
keys
.
size
}
keys to the authorized_keys file"
log
"Finished managing sshkeys"
return
true
end
# this will also trigger the run of the script
...
...
files/user_scripts/update_mode/update_mode.rb
View file @
451aec94
...
...
@@ -33,6 +33,7 @@ def run_script
log
"Errors might occur, as files got removed or renamed. You can ignore them in this step."
reset_update_mode
log
"done."
return
true
end
def
perm_file
...
...
files/user_scripts/update_wordpress/update_wordpress.rb
View file @
451aec94
...
...
@@ -25,10 +25,11 @@ end
# the main method
def
run_script
log
"Starting wordpress upgrade"
wp_directories
.
each
do
|
wd
|
success
=
wp_directories
.
all?
do
|
wd
|
upgrade_wordpress
(
wd
)
end
log
"Finished wordpress upgrade"
return
success
end
## script specific methods
...
...
@@ -79,6 +80,7 @@ def upgrade_wordpress(wd)
log
"Upgrading Wordpress in
#{
wd
}
finished."
rescue
=>
e
log
"Error while upgrading wordpress in
#{
wd
}
:
#{
e
.
message
}
"
return
false
end
# this will also trigger the run of the script
...
...
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