summaryrefslogtreecommitdiff
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
parentf61f881d6428aa4935d593dcc11bcd25559d510f (diff)
downloadopenwrt-personal-pkgs-0ab34c42554d00099aa50beb1828b0ebaec641af.tar.gz
openwrt-personal-pkgs-0ab34c42554d00099aa50beb1828b0ebaec641af.tar.bz2
openwrt-personal-pkgs-0ab34c42554d00099aa50beb1828b0ebaec641af.zip
personal-enabler: add
-rw-r--r--personal-enabler/Makefile34
-rw-r--r--personal-enabler/files/common.sh26
-rw-r--r--personal-enabler/files/sentinel.sh10
-rw-r--r--updater.lua3
4 files changed, 72 insertions, 1 deletions
diff --git a/personal-enabler/Makefile b/personal-enabler/Makefile
new file mode 100644
index 0000000..a592879
--- /dev/null
+++ b/personal-enabler/Makefile
@@ -0,0 +1,34 @@
+#
+## Copyright (C) 2020 Karel Kočí
+#
+## This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+# #
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=personal-enabler
+PKG_VERSION:=1.0.0
+PKG_MAINTAINER:=Karel Kočí <cynerd@email.cz>
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
+
+include $(INCLUDE_DIR)/package.mk
+
+define PKG
+
+define Package/personal-enabler-$(1)
+ TITLE:=Personal configurator: $(1)
+ DEPENDS:=+uci $(2)
+endef
+
+define Package/personal-enabler-$(1)/install
+ $(INSTALL_DIR) $(1)/etc/uci-defaults
+ $(INSTALL_BIN) ./files/$(1).sh $(1)/etc/uci-defaults/60-$(1)
+endef
+
+endef
+
+Build/Compile:=:
+
+$(eval $(call PKG,common,+updater-ng +user-notify))
+$(eval $(call PKG,sentinel,+pkglists +sentinel-proxy))
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
diff --git a/personal-enabler/files/sentinel.sh b/personal-enabler/files/sentinel.sh
new file mode 100644
index 0000000..2fa31da
--- /dev/null
+++ b/personal-enabler/files/sentinel.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+uci -q batch <<EOF
+ del_list pkglists.pkglists.pkglist='datacollect'
+ add_list pkglists.pkglists.pkglist='datacollect'
+ commit pkglists
+
+ set sentinel.main.agreed_with_eula_version='1'
+ commit sentinel.main
+EOF
+sentinel-reload
diff --git a/updater.lua b/updater.lua
index adcaab7..e64908e 100644
--- a/updater.lua
+++ b/updater.lua
@@ -54,6 +54,7 @@ elseif hostname:match("^work-") then
end
if tools then
+ Install("personal-enabler-common")
Install("tree", "grep", "coreutils-sha256sum")
Install("iperf", "iperf3")
Install("sysstat", "strace")
@@ -70,5 +71,5 @@ if bigclown then
Install("bigclown-leds")
end
if sentinel then
- Install("sentinel-minipot", "sentinel-nikola", "sentinel-dynfw-client")
+ Install("personal-enabler-sentinel")
end