diff options
author | Ted Trask <ttrask01@yahoo.com> | 2013-05-26 13:20:29 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2013-05-26 13:20:29 +0000 |
commit | 2bd006bd9c7de05ba6f99d9900ed97b7094e68ae (patch) | |
tree | be4729941dfee62eb7f38b3e78937647568a87b5 /main/acf-provisioning | |
parent | 365c1625a8210208ce6fcb08361f587ad501342d (diff) | |
download | aports-2bd006bd9c7de05ba6f99d9900ed97b7094e68ae.tar.bz2 aports-2bd006bd9c7de05ba6f99d9900ed97b7094e68ae.tar.xz |
main/acf-provisioning: upgrade to 0.3.1
Diffstat (limited to 'main/acf-provisioning')
-rw-r--r-- | main/acf-provisioning/APKBUILD | 8 | ||||
-rw-r--r-- | main/acf-provisioning/acf-provisioning.post-upgrade | 223 |
2 files changed, 5 insertions, 226 deletions
diff --git a/main/acf-provisioning/APKBUILD b/main/acf-provisioning/APKBUILD index 958644e8b8..db42c4d3c1 100644 --- a/main/acf-provisioning/APKBUILD +++ b/main/acf-provisioning/APKBUILD @@ -1,7 +1,7 @@ # Contributor: Ted Trask <ttrask01@yahoo.com> # Maintainer: Ted Trask <ttrask01@yahoo.com> pkgname=acf-provisioning -pkgver=0.3.0 +pkgver=0.3.1 pkgrel=0 pkgdesc="ACF for provisioning templated configs to devices" url="http://git.alpinelinux.org/cgit/acf-provisioning" @@ -9,7 +9,7 @@ arch="noarch" license="GPL-2" depends="acf-core lua lua-sql-postgres postgresql-client lua-posixtz" makedepends="" -install="$pkgname.post-upgrade" +install="" subpackages="" source="http://git.alpinelinux.org/cgit/$pkgname/snapshot/$pkgname-$pkgver.tar.bz2" @@ -18,4 +18,6 @@ package() { make DESTDIR="$pkgdir" install } -md5sums="842176941fbac241cb06ed28cf2334a8 acf-provisioning-0.3.0.tar.bz2" +md5sums="2dbf7c7ae70139d709a71ac04127082a acf-provisioning-0.3.1.tar.bz2" +sha256sums="7403158d8289f4f11b699f152bfbdc647e0c140ff8cf1e38d3a1f55addcbbd69 acf-provisioning-0.3.1.tar.bz2" +sha512sums="6ab1d095fb0217281b59328d3a2dd44e61b5d77d5eed307c0ba81b52d2832a427a643201263505be73e7f25d42ad767176f73c3cf16113d89ed647f918d03365 acf-provisioning-0.3.1.tar.bz2" diff --git a/main/acf-provisioning/acf-provisioning.post-upgrade b/main/acf-provisioning/acf-provisioning.post-upgrade deleted file mode 100644 index 1ed6aa56de..0000000000 --- a/main/acf-provisioning/acf-provisioning.post-upgrade +++ /dev/null @@ -1,223 +0,0 @@ -#!/bin/sh - -new=$1 -old=$2 - -# if current is older than 0.0.7-r1 we update. -if [ "$(apk version -t $old 0.0.7-r1)" = "<" ]; then - -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 - -fi - -# if current is older than 0.0.8 we update. -if [ "$(apk version -t $old 0.0.8)" = "<" ]; then - -psql -U postgres -c "ALTER TABLE provisioning_params ADD COLUMN validate text" provisioning - -psql -U postgres -c "UPDATE provisioning_params SET descr='Phone dial pattern based on section 2.1.5 of RFC 3435, plus a comma to turn dialtone back on', regexp='^[*#0-9xT|,.%[%]-]*\$' WHERE name='digitmap'" provisioning -psql -U postgres -c "UPDATE provisioning_params SET descr='Timeout in seconds for each segment of digit map (separated by ''|'')', regexp='^[0-9|]*\$' WHERE name='digitmaptimeout'" provisioning - -psql -U postgres -c "UPDATE provisioning_params SET regexp='^%x%x%x%x%x%x%x%x%x%x%x%x\$', validate='local value, functions, params = ...\nvalue = string.upper(value)\nlocal others = functions.getselectresponse(\"SELECT count(*) FROM provisioning_values WHERE param_id=\\'\"..params.value.device.value.mac.param_id..\"\\' AND device_id!=\\'\"..params.value.device_id.value..\"\\' AND value=\\'\"..value..\"\\'\")\nif tonumber(others[1].count) > 0 then\n\treturn value, \"MAC Address must be unique\"\nend\nreturn value' WHERE name='mac'" provisioning - -psql -U postgres -c "INSERT INTO provisioning_params VALUES(default, 'callwaitingenable', 'boolean', 'Call Waiting Enable', '', 'true', '205', '', null)" provisioning -psql -U postgres -c "INSERT INTO provisioning_params VALUES(default, 'speeddialenable', 'boolean', 'Speed Dial Enable', '', 'true', '206', '', null)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Standard Phone'), (SELECT param_id FROM provisioning_params WHERE name='callwaitingenable'), 'true', false)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Standard Phone'), (SELECT param_id FROM provisioning_params WHERE name='speeddialenable'), 'true', false)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Public Phone'), (SELECT param_id FROM provisioning_params WHERE name='callwaitingenable'), 'true', false)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Public Phone'), (SELECT param_id FROM provisioning_params WHERE name='speeddialenable'), 'false', false)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Hotline'), (SELECT param_id FROM provisioning_params WHERE name='callwaitingenable'), 'true', false)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Hotline'), (SELECT param_id FROM provisioning_params WHERE name='speeddialenable'), 'false', false)" provisioning - -fi - -# if current is older than 0.0.9 we update. -if [ "$(apk version -t $old 0.0.9)" = "<" ]; then - -psql -U postgres -c "INSERT INTO provisioning_params VALUES(default, 'mailbox', 'text', 'Voice Mailbox', 'Mailbox extension or URL', '', '207', '', null)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Standard Phone'), (SELECT param_id FROM provisioning_params WHERE name='mailbox'), '', true)" provisioning - -fi - -# if current is older than 0.0.11 we update. -if [ "$(apk version -t $old 0.0.11)" = "<" ]; then - -psql -U postgres -c "INSERT INTO provisioning_classes VALUES(default, (SELECT class_group_id FROM provisioning_class_groups WHERE name='device'), 'Polycom SoundPoint IP 450 SIP', '2')" provisioning -psql -U postgres -c "INSERT INTO provisioning_classes VALUES(default, (SELECT class_group_id FROM provisioning_class_groups WHERE name='device'), 'Polycom SoundPoint IP 550/560 SIP', '3')" provisioning -psql -U postgres -c "INSERT INTO provisioning_classes VALUES(default, (SELECT class_group_id FROM provisioning_class_groups WHERE name='device'), 'Polycom VVX 1500', '6')" provisioning -psql -U postgres -c "UPDATE provisioning_classes SET label='Polycom SoundStation IP 5000/6000/7000 SIP', seq='5' WHERE label='Polycom SoundStation IP 6000 SIP'" provisioning -psql -U postgres -c "UPDATE provisioning_classes SET label='Polycom SoundPoint IP 320/321/330/331/335 SIP', seq='1' WHERE label='Polycom SoundPoint IP 321/331/335 SIP'" provisioning -psql -U postgres -c "UPDATE provisioning_classes SET label='Polycom SoundPoint IP 650/670 SIP', seq='4' WHERE label='Polycom SoundPoint IP 650 SIP'" provisioning -psql -U postgres -c "UPDATE provisioning_classes SET seq='7' WHERE label='Linksys Internet Phone Adapter PAP2T'" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Polycom SoundPoint IP 450 SIP'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 1'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Polycom SoundPoint IP 450 SIP'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 2'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Polycom SoundPoint IP 450 SIP'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 3'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Polycom SoundPoint IP 450 SIP'), (SELECT group_id FROM provisioning_groups WHERE label='Polycom Device'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Polycom SoundPoint IP 550/560 SIP'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 1'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Polycom SoundPoint IP 550/560 SIP'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 2'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Polycom SoundPoint IP 550/560 SIP'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 3'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Polycom SoundPoint IP 550/560 SIP'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 4'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Polycom SoundPoint IP 550/560 SIP'), (SELECT group_id FROM provisioning_groups WHERE label='Polycom Device'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Polycom VVX 1500'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 1'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Polycom VVX 1500'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 2'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Polycom VVX 1500'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 3'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Polycom VVX 1500'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 4'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Polycom VVX 1500'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 5'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Polycom VVX 1500'), (SELECT group_id FROM provisioning_groups WHERE label='Polycom Device'))" provisioning -psql -U postgres -c "UPDATE param_groups_to_params SET value=null WHERE group_id=(SELECT group_id FROM provisioning_groups WHERE label='Standard Phone') AND param_id=(SELECT param_id FROM provisioning_params WHERE name='mailbox')" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Standard Phone'), (SELECT param_id FROM provisioning_params WHERE name='mailcallback'), null, true)" provisioning -psql -U postgres -c "INSERT INTO provisioning_params VALUES(default, 'mailcallback', 'text', 'Voice Mailbox Callback', 'Extension or URL for mailbox message retrieval', '', '208', '', null)" provisioning - -fi - -# if current is older than 0.1.1 we update. -if [ "$(apk version -t $old 0.1.1)" = "<" ]; then - -psql -U postgres -c "INSERT INTO provisioning_groups VALUES(default, 'device', 'Snom Device', '1')" provisioning -psql -U postgres -c "INSERT INTO provisioning_groups VALUES(default, 'reg1', 'Registration 1 No Forwarding', '10')" provisioning -psql -U postgres -c "INSERT INTO provisioning_groups VALUES(default, 'reg2', 'Registration 2 No Forwarding', '10')" provisioning -psql -U postgres -c "INSERT INTO provisioning_groups VALUES(default, 'reg3', 'Registration 3 No Forwarding', '10')" provisioning -psql -U postgres -c "INSERT INTO provisioning_groups VALUES(default, 'reg4', 'Registration 4 No Forwarding', '10')" provisioning -psql -U postgres -c "INSERT INTO provisioning_groups VALUES(default, 'reg5', 'Registration 5 No Forwarding', '10')" provisioning -psql -U postgres -c "INSERT INTO provisioning_groups VALUES(default, 'reg6', 'Registration 6 No Forwarding', '10')" provisioning -psql -U postgres -c "INSERT INTO provisioning_groups VALUES(default, 'reg7', 'Registration 7 No Forwarding', '10')" provisioning -psql -U postgres -c "INSERT INTO provisioning_groups VALUES(default, 'reg8', 'Registration 8 No Forwarding', '10')" provisioning -psql -U postgres -c "INSERT INTO provisioning_groups VALUES(default, 'reg9', 'Registration 9 No Forwarding', '10')" provisioning -psql -U postgres -c "INSERT INTO provisioning_groups VALUES(default, 'reg10', 'Registration 10 No Forwarding', '11')" provisioning -psql -U postgres -c "INSERT INTO provisioning_groups VALUES(default, 'reg11', 'Registration 11 No Forwarding', '11')" provisioning -psql -U postgres -c "INSERT INTO provisioning_groups VALUES(default, 'reg12', 'Registration 12 No Forwarding', '11')" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Snom Device'), (SELECT param_id FROM provisioning_params WHERE name='template'), '/etc/provisioning/templates/snom-template.lua', false)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Snom Device'), (SELECT param_id FROM provisioning_params WHERE name='mac'), null, true)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Snom Device'), (SELECT param_id FROM provisioning_params WHERE name='registrar'), null, false)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Snom Device'), (SELECT param_id FROM provisioning_params WHERE name='digitmap'), null, false)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Snom Device'), (SELECT param_id FROM provisioning_params WHERE name='digitmaptimeout'), null, false)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Snom Device'), (SELECT param_id FROM provisioning_params WHERE name='sntpserver'), null, false)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Snom Device'), (SELECT param_id FROM provisioning_params WHERE name='timezone'), null, false)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Snom Device'), (SELECT param_id FROM provisioning_params WHERE name='musiconhold'), null, false)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Snom Device'), (SELECT param_id FROM provisioning_params WHERE name='adminpassword'), null, false)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Snom Device'), (SELECT param_id FROM provisioning_params WHERE name='pcportenable'), null, false)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Snom Device'), (SELECT param_id FROM provisioning_params WHERE name='urldialingenable'), null, false)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Snom Device'), (SELECT param_id FROM provisioning_params WHERE name='forwardnoanswer'), null, true)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Snom Device'), (SELECT param_id FROM provisioning_params WHERE name='forwardnoanswerenable'), null, true)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Snom Device'), (SELECT param_id FROM provisioning_params WHERE name='forwardbusy'), null, true)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Snom Device'), (SELECT param_id FROM provisioning_params WHERE name='forwardbusyenable'), null, true)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Snom Device'), (SELECT param_id FROM provisioning_params WHERE name='forwardall'), null, true)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Snom Device'), (SELECT param_id FROM provisioning_params WHERE name='forwardallenable'), null, true)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 1 No Forwarding'), (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 No Forwarding'), (SELECT param_id FROM provisioning_params WHERE name='password'), null, false)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 1 No Forwarding'), (SELECT param_id FROM provisioning_params WHERE name='callerid'), null, true)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 2 No Forwarding'), (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 2 No Forwarding'), (SELECT param_id FROM provisioning_params WHERE name='password'), null, false)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 2 No Forwarding'), (SELECT param_id FROM provisioning_params WHERE name='callerid'), null, true)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 3 No Forwarding'), (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 3 No Forwarding'), (SELECT param_id FROM provisioning_params WHERE name='password'), null, false)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 3 No Forwarding'), (SELECT param_id FROM provisioning_params WHERE name='callerid'), null, true)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 4 No Forwarding'), (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 4 No Forwarding'), (SELECT param_id FROM provisioning_params WHERE name='password'), null, false)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 4 No Forwarding'), (SELECT param_id FROM provisioning_params WHERE name='callerid'), null, true)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 5 No Forwarding'), (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 5 No Forwarding'), (SELECT param_id FROM provisioning_params WHERE name='password'), null, false)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 5 No Forwarding'), (SELECT param_id FROM provisioning_params WHERE name='callerid'), null, true)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 6 No Forwarding'), (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 6 No Forwarding'), (SELECT param_id FROM provisioning_params WHERE name='password'), null, false)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 6 No Forwarding'), (SELECT param_id FROM provisioning_params WHERE name='callerid'), null, true)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 7 No Forwarding'), (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 7 No Forwarding'), (SELECT param_id FROM provisioning_params WHERE name='password'), null, false)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 7 No Forwarding'), (SELECT param_id FROM provisioning_params WHERE name='callerid'), null, true)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 8 No Forwarding'), (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 8 No Forwarding'), (SELECT param_id FROM provisioning_params WHERE name='password'), null, false)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 8 No Forwarding'), (SELECT param_id FROM provisioning_params WHERE name='callerid'), null, true)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 9 No Forwarding'), (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 9 No Forwarding'), (SELECT param_id FROM provisioning_params WHERE name='password'), null, false)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 9 No Forwarding'), (SELECT param_id FROM provisioning_params WHERE name='callerid'), null, true)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 10 No Forwarding'), (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 10 No Forwarding'), (SELECT param_id FROM provisioning_params WHERE name='password'), null, false)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 10 No Forwarding'), (SELECT param_id FROM provisioning_params WHERE name='callerid'), null, true)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 11 No Forwarding'), (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 11 No Forwarding'), (SELECT param_id FROM provisioning_params WHERE name='password'), null, false)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 11 No Forwarding'), (SELECT param_id FROM provisioning_params WHERE name='callerid'), null, true)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 12 No Forwarding'), (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 12 No Forwarding'), (SELECT param_id FROM provisioning_params WHERE name='password'), null, false)" provisioning -psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 12 No Forwarding'), (SELECT param_id FROM provisioning_params WHERE name='callerid'), null, true)" provisioning -psql -U postgres -c "INSERT INTO provisioning_options VALUES((SELECT param_id FROM provisioning_params WHERE name='template'), 'Snom', '/etc/provisioning/templates/snom-template.lua', '3')" provisioning -psql -U postgres -c "INSERT INTO provisioning_classes VALUES(default, (SELECT class_group_id FROM provisioning_class_groups WHERE name='device'), 'Snom 300', '10')" provisioning -psql -U postgres -c "INSERT INTO provisioning_classes VALUES(default, (SELECT class_group_id FROM provisioning_class_groups WHERE name='device'), 'Snom 320/360/370', '11')" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Snom 300'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 1 No Forwarding'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Snom 300'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 2 No Forwarding'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Snom 300'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 3 No Forwarding'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Snom 300'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 4 No Forwarding'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Snom 300'), (SELECT group_id FROM provisioning_groups WHERE label='Snom Device'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Snom 320/360/370'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 1 No Forwarding'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Snom 320/360/370'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 2 No Forwarding'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Snom 320/360/370'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 3 No Forwarding'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Snom 320/360/370'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 4 No Forwarding'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Snom 320/360/370'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 5 No Forwarding'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Snom 320/360/370'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 6 No Forwarding'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Snom 320/360/370'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 7 No Forwarding'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Snom 320/360/370'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 8 No Forwarding'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Snom 320/360/370'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 9 No Forwarding'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Snom 320/360/370'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 10 No Forwarding'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Snom 320/360/370'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 11 No Forwarding'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Snom 320/360/370'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 12 No Forwarding'))" provisioning -psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Snom 320/360/370'), (SELECT group_id FROM provisioning_groups WHERE label='Snom Device'))" provisioning -psql -U postgres -c "UPDATE provisioning_params SET value='UTC0' WHERE name='timezone' and value=''" provisioning - -fi - -# if current is older than 0.1.2 we update. -if [ "$(apk version -t $old 0.1.2)" = "<" ]; then - -for a in $(seq 1 34); do - psql -U postgres -c "UPDATE provisioning_groups SET label='Registration $a (Polycom)' WHERE label='Registration $a'" provisioning -done -for a in $(seq 1 12); do - psql -U postgres -c "UPDATE provisioning_groups SET label='Registration $a (Snom)' WHERE label='Registration $a No Forwarding'" provisioning -done -psql -U postgres -c "UPDATE provisioning_groups SET label='Registration 1 (Unsupported)' WHERE label='Registration 1 Unsupported'" provisioning - - -for a in $(seq 1 2); do - psql -U postgres -c "INSERT INTO provisioning_groups VALUES(default, 'reg$a', 'Registration $a (Linksys)', '10')" provisioning - psql -U postgres -c "UPDATE classes_to_param_groups SET group_id=(SELECT group_id FROM provisioning_groups WHERE label='Registration $a (Linksys)') WHERE class_id=(SELECT class_id FROM provisioning_classes WHERE label='Linksys Internet Phone Adapter PAP2T') AND group_id=(SELECT group_id FROM provisioning_groups WHERE label='Registration $a (Polycom)')" provisioning - psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration $a (Linksys)'), (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 $a (Linksys)'), (SELECT param_id FROM provisioning_params WHERE name='password'), null, false)" provisioning - psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration $a (Linksys)'), (SELECT param_id FROM provisioning_params WHERE name='forwardnoanswer'), null, true)" provisioning - psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration $a (Linksys)'), (SELECT param_id FROM provisioning_params WHERE name='forwardnoanswerenable'), null, true)" provisioning - psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration $a (Linksys)'), (SELECT param_id FROM provisioning_params WHERE name='forwardbusy'), null, true)" provisioning - psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration $a (Linksys)'), (SELECT param_id FROM provisioning_params WHERE name='forwardbusyenable'), null, true)" provisioning - psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration $a (Linksys)'), (SELECT param_id FROM provisioning_params WHERE name='forwardall'), null, true)" provisioning - psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration $a (Linksys)'), (SELECT param_id FROM provisioning_params WHERE name='forwardallenable'), null, true)" provisioning - psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration $a (Linksys)'), (SELECT param_id FROM provisioning_params WHERE name='callerid'), null, true)" provisioning -done - -psql -U postgres -c "INSERT INTO provisioning_params VALUES(default, 'polycomringtone', 'select', 'Ring Tone (Polycom)', '', '2', '110', '', null)" provisioning -psql -U postgres -c "INSERT INTO provisioning_options VALUES((SELECT param_id FROM provisioning_params WHERE name='polycomringtone'), 'Silent Ring', '1', '1')" provisioning -psql -U postgres -c "INSERT INTO provisioning_options VALUES((SELECT param_id FROM provisioning_params WHERE name='polycomringtone'), 'Low Trill', '2', '2')" provisioning -psql -U postgres -c "INSERT INTO provisioning_options VALUES((SELECT param_id FROM provisioning_params WHERE name='polycomringtone'), 'Low Double Trill', '3', '3')" provisioning -psql -U postgres -c "INSERT INTO provisioning_options VALUES((SELECT param_id FROM provisioning_params WHERE name='polycomringtone'), 'Medium Trill', '4', '4')" provisioning -psql -U postgres -c "INSERT INTO provisioning_options VALUES((SELECT param_id FROM provisioning_params WHERE name='polycomringtone'), 'Medium Double Trill', '5', '5')" provisioning -psql -U postgres -c "INSERT INTO provisioning_options VALUES((SELECT param_id FROM provisioning_params WHERE name='polycomringtone'), 'High Trill', '6', '6')" provisioning -psql -U postgres -c "INSERT INTO provisioning_options VALUES((SELECT param_id FROM provisioning_params WHERE name='polycomringtone'), 'High Double Trill', '7', '7')" provisioning -psql -U postgres -c "INSERT INTO provisioning_options VALUES((SELECT param_id FROM provisioning_params WHERE name='polycomringtone'), 'Highest Trill', '8', '8')" provisioning -psql -U postgres -c "INSERT INTO provisioning_options VALUES((SELECT param_id FROM provisioning_params WHERE name='polycomringtone'), 'Highest Double Trill', '9', '9')" provisioning -psql -U postgres -c "INSERT INTO provisioning_options VALUES((SELECT param_id FROM provisioning_params WHERE name='polycomringtone'), 'Beeble', '10', '10')" provisioning -psql -U postgres -c "INSERT INTO provisioning_options VALUES((SELECT param_id FROM provisioning_params WHERE name='polycomringtone'), 'Triplet', '11', '11')" provisioning -psql -U postgres -c "INSERT INTO provisioning_options VALUES((SELECT param_id FROM provisioning_params WHERE name='polycomringtone'), 'Ringback-style', '12', '12')" provisioning -psql -U postgres -c "INSERT INTO provisioning_options VALUES((SELECT param_id FROM provisioning_params WHERE name='polycomringtone'), 'Low Trill Precedence', '13', '13')" provisioning -psql -U postgres -c "INSERT INTO provisioning_options VALUES((SELECT param_id FROM provisioning_params WHERE name='polycomringtone'), 'Ring Splash', '14', '14')" provisioning -for a in $(seq 1 34); do - psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration $a (Polycom)'), (SELECT param_id FROM provisioning_params WHERE name='polycomringtone'), null, true)" provisioning -done - -fi - -exit 0 |