From fd4222f65d7a656cb4393e3b87000ed7ac33019b Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Mon, 30 Sep 2013 23:31:35 +0200 Subject: [PATCH] gluon-autoupdater: read config from site.conf --- package/gluon-autoupdater/Makefile | 4 +++- package/gluon-autoupdater/autoupdater.pl | 23 +++++++++++++++++++ .../files/etc/config/autoupdater | 2 +- .../files/usr/sbin/autoupdate | 12 +++++----- 4 files changed, 33 insertions(+), 8 deletions(-) create mode 100644 package/gluon-autoupdater/autoupdater.pl diff --git a/package/gluon-autoupdater/Makefile b/package/gluon-autoupdater/Makefile index 09c398de..43d9beb9 100644 --- a/package/gluon-autoupdater/Makefile +++ b/package/gluon-autoupdater/Makefile @@ -23,11 +23,13 @@ define Build/Configure endef define Build/Compile + $(GLUON_CONFIGURE) autoupdater.pl > $(PKG_BUILD_DIR)/autoupdater.sh endef define Package/gluon-autoupdater/install $(CP) ./files/* $(1)/ - chmod +x $(1)/usr/sbin/autoupdate + $(INSTALL_DIR) $(1)/lib/gluon/upgrade/autoupdater/initial + $(INSTALL_BIN) $(PKG_BUILD_DIR)/autoupdater.sh $(1)/lib/gluon/upgrade/autoupdater/initial/010-autoupdater endef $(eval $(call BuildPackage,gluon-autoupdater)) diff --git a/package/gluon-autoupdater/autoupdater.pl b/package/gluon-autoupdater/autoupdater.pl new file mode 100644 index 00000000..88bac9f6 --- /dev/null +++ b/package/gluon-autoupdater/autoupdater.pl @@ -0,0 +1,23 @@ +my $cfg = $CONFIG->{autoupdater}; + +print <<'END'; +#/bin/sh + +uci -q batch < $PROBABILITY}" @@ -15,10 +15,10 @@ if test "a$1" != "a-f"; then fi fi -BASE=$(uci get autoupdater.@autoupdater[0].url) -PUBKEYS=$(uci get autoupdater.@autoupdater[0].pubkey) -GOOD_SIGNATURES=$(uci get autoupdater.@autoupdater[0].good_signatures) -BRANCH=$(uci get autoupdater.@autoupdater[0].branch) +BASE=$(uci get autoupdater.default.url) +PUBKEYS=$(uci get autoupdater.default.pubkey) +GOOD_SIGNATURES=$(uci get autoupdater.default.good_signatures) +BRANCH=$(uci get autoupdater.default.branch) VERSION_FILE=/lib/gluon/release