Skip to content
Snippets Groups Projects
Commit 76904f73 authored by Jan Čermák's avatar Jan Čermák
Browse files

Merge branch 'english_notify' of https://github.com/oskar456/turris-misc into...

Merge branch 'english_notify' of https://github.com/oskar456/turris-misc into oskar456-english_notify
parents d7a3532f 54ee6fa9
No related branches found
No related tags found
No related merge requests found
......@@ -107,7 +107,11 @@ schedule_restart() {
local wanted_time="$(($curr_date + $delay))$time"
echo "reboot" | at -t $($date_cmd +"%y%m%d%H%M" -d "$wanted_time")
echo -e "Zařízení bude automaticky restartováno dne $($date_cmd +'%d. %m. %Y v %H:%M' -d $wanted_time).\n" >> $1
if [ "$lang" = "cs" ]; then
echo -e "Zařízení bude automaticky restartováno dne $($date_cmd +'%d. %m. %Y v %H:%M' -d $wanted_time).\n" >> $1
else
echo -e "The device will be restarted automatically on $($date_cmd +'%A, %B %e at %I:%M %p' -d $wanted_time).\n" >> $1
fi
}
compose_message() {
......@@ -125,8 +129,16 @@ compose_message() {
local hostname=`cat /proc/sys/kernel/hostname`
if [ "$lang" = "cs" ]; then
local mail_subject="=?utf-8?Q?Upozorn=C4=9Bn=C3=AD?= od =?utf-8?Q?Va=C5=A1eho?= routeru $hostname"
local heading_restart="Žádosti o restart zařízení"
local heading_errors="Oznámení o chybách"
local heading_updates="Oznámení o aktualizacích"
local heading_news="Oznámení o novinkách"
else
local mail_subject="Notification from your router $hostname"
local heading_restart="Restart is needed"
local heading_errors="Error notifications"
local heading_updates="Update notifications"
local heading_news="News announcements"
fi
local msg_list=`ls "$base_folder"`
......@@ -172,7 +184,7 @@ compose_message() {
cat "$locker_stamp/stamps.restarts" >> "$locker_stamp/stamps"
if [ "$severity" -ge 1 ]; then
echo -e "##### Žádosti o restart zařízení #####" >> "$msg_file.tmp"
echo -e "##### $heading_restart #####" >> "$msg_file.tmp"
cat "$msg_file.restarts" >> "$msg_file.tmp"
fi
fi
......@@ -180,7 +192,7 @@ compose_message() {
cat "$locker_stamp/stamps.errors" >> "$locker_stamp/stamps"
if [ "$severity" -ge 2 ]; then
echo -e "##### Oznámení o chybách #####" >> "$msg_file.tmp"
echo -e "##### $heading_errors #####" >> "$msg_file.tmp"
cat "$msg_file.errors" >> "$msg_file.tmp"
fi
fi
......@@ -188,7 +200,7 @@ compose_message() {
cat "$locker_stamp/stamps.updates" >> "$locker_stamp/stamps"
if [ "$severity" -ge 3 ]; then
echo -e "##### Oznámení o aktualizacích #####" >> "$msg_file.tmp"
echo -e "##### $heading_updates #####" >> "$msg_file.tmp"
cat "$msg_file.updates" >> "$msg_file.tmp"
fi
fi
......@@ -196,7 +208,7 @@ compose_message() {
cat "$locker_stamp/stamps.news" >> "$locker_stamp/stamps"
if [ "$news" -gt 0 ]; then
echo -e "##### Oznámení o novinkách #####" >> "$msg_file.tmp"
echo -e "##### $heading_news #####" >> "$msg_file.tmp"
cat "$msg_file.news" >> "$msg_file.tmp"
fi
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment