summaryrefslogtreecommitdiff
path: root/personal-enabler/files/common.sh
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2020-07-26 10:29:15 +0200
committerKarel Kočí <cynerd@email.cz>2020-07-26 10:29:15 +0200
commit0ab34c42554d00099aa50beb1828b0ebaec641af (patch)
tree4df7b82b66e7efd0d55f9d14bba27429908a0ac3 /personal-enabler/files/common.sh
parentf61f881d6428aa4935d593dcc11bcd25559d510f (diff)
downloadopenwrt-personal-pkgs-0ab34c42554d00099aa50beb1828b0ebaec641af.tar.gz
openwrt-personal-pkgs-0ab34c42554d00099aa50beb1828b0ebaec641af.tar.bz2
openwrt-personal-pkgs-0ab34c42554d00099aa50beb1828b0ebaec641af.zip
personal-enabler: add
Diffstat (limited to 'personal-enabler/files/common.sh')
-rw-r--r--personal-enabler/files/common.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/personal-enabler/files/common.sh b/personal-enabler/files/common.sh
new file mode 100644
index 0000000..b6469ee
--- /dev/null
+++ b/personal-enabler/files/common.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+hostname="$(uci get system.@system[0].hostname)"
+case "$hostname" in
+ work-*)
+ mail="karel.koci@nic.cz"
+ ;;
+ *)
+ mail="cynerd@email.cz"
+ ;;
+esac
+
+uci -q batch <<EOF
+ set updater.autorun.enable=1
+ commit updater
+
+ set user_notify.smtp.enable=1
+ set user_notify.smtp.use_turris_smtp=1
+ set user_notify.smtp.sender_name='${hostname}'
+ del_list user_notify.smtp.to='${mail}'
+ add_list user_notify.smtp.to='${mail}'
+ set user_notify.notifications.news=1
+ set user_notify.notifications.severity=3
+ set user_notify.reboot.delay='2'
+ set user_notify.time='03:30'
+ commit user_notify
+EOF