mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-20 21:34:11 -07:00
web backup scheduler
This commit is contained in:
parent
293b70fcf2
commit
bbba9aeb34
13 changed files with 278 additions and 80 deletions
36
web/inc/mail-wrapper.php
Executable file
36
web/inc/mail-wrapper.php
Executable file
|
@ -0,0 +1,36 @@
|
|||
#!/usr/local/vesta/php/bin/php
|
||||
<?php
|
||||
|
||||
if (empty($argv[1])) {
|
||||
echo "Error: not enough arguments\n";
|
||||
exit(3);
|
||||
}
|
||||
|
||||
$options = getopt("s:f:");
|
||||
|
||||
|
||||
define('NO_AUTH_REQUIRED',true);
|
||||
include("/usr/local/vesta/web/inc/main.php");
|
||||
|
||||
// Set system language
|
||||
exec (VESTA_CMD . "v-list-sys-config json", $output, $return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (!empty( $data['config']['LANGUAGE'])) {
|
||||
$_SESSION['language'] = $data['config']['LANGUAGE'];
|
||||
} else {
|
||||
$_SESSION['language'] = 'en';
|
||||
}
|
||||
require_once('/usr/local/vesta/web/inc/i18n/'.$_SESSION['language'].'.php');
|
||||
|
||||
// Define vars
|
||||
$from = 'Vesta Control Panel <vesta@'.$_SERVER["HOSTNAME"].'>';
|
||||
$to = $argv[3]."\n";
|
||||
$subject = $argv[2]."\n";
|
||||
$mailtext = file_get_contents("php://stdin");
|
||||
|
||||
// Send email
|
||||
if ((!empty($to)) && (!empty($subject))) {
|
||||
send_email($to,$subject,$mailtext,$from);
|
||||
}
|
||||
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue