File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ def quit_handler(_signo=None, _stack_frame=None):
98
98
path = commands [2 ][:len_path ] + "/scripts"
99
99
Plugin .PATH = path
100
100
else :
101
- path = "./scripts"
101
+ path = os . getcwd ()
102
102
Plugin .PATH = path
103
103
# create directory for scripts along the path of conf file if needed
104
104
if not os .path .exists (path ):
@@ -110,8 +110,10 @@ def quit_handler(_signo=None, _stack_frame=None):
110
110
f .write (template .txt (args .plugin_type , plugins )) # pass command type
111
111
# write bash scripts for zabbix - agent to a file
112
112
for key in Scripts .Bash :
113
- with codecs .open (path + "/" + key + ".sh" , 'w' , 'utf-8' ) as f :
113
+ with codecs .open (path + "/" + key + ".sh" , 'w+ ' , 'utf-8' ) as f :
114
114
f .write (Scripts .Bash [key ]) # pass script itself
115
+ os .chmod (path + "/" + key + ".sh" , 0o744 )
116
+ print ("Bash scripts for native zabbix agent have been saved to {0}" .format (path ))
115
117
else :
116
118
print_total_help ()
117
119
sys .exit (0 )
You can’t perform that action at this time.
0 commit comments