aboutsummaryrefslogtreecommitdiffstats
path: root/main/acf-provisioning
diff options
context:
space:
mode:
Diffstat (limited to 'main/acf-provisioning')
-rw-r--r--main/acf-provisioning/APKBUILD4
-rw-r--r--main/acf-provisioning/acf-provisioning.post-upgrade23
2 files changed, 25 insertions, 2 deletions
diff --git a/main/acf-provisioning/APKBUILD b/main/acf-provisioning/APKBUILD
index 00faf59bc6..ca84ead0b4 100644
--- a/main/acf-provisioning/APKBUILD
+++ b/main/acf-provisioning/APKBUILD
@@ -2,14 +2,14 @@
# Maintainer: Ted Trask <ttrask01@yahoo.com>
pkgname=acf-provisioning
pkgver=0.0.7
-pkgrel=0
+pkgrel=1
pkgdesc="ACF for provisioning templated configs to devices"
url="http://git.alpinelinux.org/cgit/acf-provisioning"
arch="noarch"
license="GPL-2"
depends="acf-core lua lua-sql-postgres postgresql-client lua-posixtz"
makedepends=""
-install=""
+install="$pkgname.post-upgrade"
subpackages=""
source="http://git.alpinelinux.org/cgit/$pkgname.git/snapshot/$pkgname-$pkgver.tar.bz2"
diff --git a/main/acf-provisioning/acf-provisioning.post-upgrade b/main/acf-provisioning/acf-provisioning.post-upgrade
new file mode 100644
index 0000000000..035be21475
--- /dev/null
+++ b/main/acf-provisioning/acf-provisioning.post-upgrade
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+new=$1
+old=$2
+
+# if current is not older than 0.0.7-r1 we exit.
+if ! [ "$(apk version -t $old 0.0.7-r1)" = "<" ]; then
+ exit 0
+fi
+
+psql -U postgres -c "INSERT INTO provisioning_classes VALUES(default, (SELECT class_group_id FROM provisioning_class_groups WHERE name='device'), 'Unsupported Phone', '999')"\
+ provisioning
+psql -U postgres -c "INSERT INTO provisioning_groups VALUES(default, 'reg1', 'Registration 1 Unsupported', '10')"\
+ provisioning
+psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Unsupported Phone'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 1 Unsupported'))"\
+ provisioning
+psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 1 Unsupported'), (SELECT param_id FROM provisioning_params WHERE name='extension'), null, true)"\
+ provisioning
+psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 1 Unsupported'), (SELECT param_id FROM provisioning_params WHERE name='password'), null, true)"\
+ provisioning
+
+exit 0
+