File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -236,7 +236,7 @@ function _setup_jailkit_chroot()
236236 $ tpl ->setVar ('home_dir ' ,$ this ->_get_home_dir ("" ));
237237
238238 $ bashrc = escapeshellcmd ($ this ->parent_domain ['document_root ' ]).'/etc/bash.bashrc ' ;
239- if (@is_file ($ bashrc )) unlink ($ bashrc );
239+ if (@is_file ($ bashrc ) || @ is_link ( $ bashrc ) ) unlink ($ bashrc );
240240
241241 file_put_contents ($ bashrc ,$ tpl ->grab ());
242242 unset($ tpl );
@@ -249,7 +249,7 @@ function _setup_jailkit_chroot()
249249 $ tpl ->setVar ('domain ' ,$ this ->parent_domain ['domain ' ]);
250250
251251 $ motd = escapeshellcmd ($ this ->parent_domain ['document_root ' ]).'/var/run/motd ' ;
252- if (@is_file ($ motd )) unlink ($ motd );
252+ if (@is_file ($ motd ) || @ is_link ( $ motd ) ) unlink ($ motd );
253253
254254 file_put_contents ($ motd ,$ tpl ->grab ());
255255
Original file line number Diff line number Diff line change @@ -227,20 +227,20 @@ function _setup_jailkit_chroot()
227227 $ tpl ->setVar ('home_dir ' ,$ this ->_get_home_dir ("" ));
228228
229229 $ bashrc = escapeshellcmd ($ this ->data ['new ' ]['dir ' ]).'/etc/bash.bashrc ' ;
230- if (@is_file ($ bashrc )) unlink ($ bashrc );
230+ if (@is_file ($ bashrc ) || @ is_link ( $ bashrc ) ) unlink ($ bashrc );
231231
232232 file_put_contents ($ bashrc ,$ tpl ->grab ());
233233 unset($ tpl );
234234
235- $ this ->app ->log ("Added bashrc scrpt : " .$ bashrc ,LOGLEVEL_DEBUG );
235+ $ this ->app ->log ("Added bashrc script : " .$ bashrc ,LOGLEVEL_DEBUG );
236236
237237 $ tpl = new tpl ();
238238 $ tpl ->newTemplate ("motd.master " );
239239
240240 $ tpl ->setVar ('domain ' ,$ web ['domain ' ]);
241241
242242 $ motd = escapeshellcmd ($ this ->data ['new ' ]['dir ' ]).'/var/run/motd ' ;
243- if (@is_file ($ motd )) unlink ($ motd );
243+ if (@is_file ($ motd ) || @ is_link ( $ motd ) ) unlink ($ motd );
244244
245245 file_put_contents ($ motd ,$ tpl ->grab ());
246246
You can’t perform that action at this time.
0 commit comments