diff options
Diffstat (limited to 'main/acf-provisioning/acf-provisioning.post-upgrade')
-rw-r--r-- | main/acf-provisioning/acf-provisioning.post-upgrade | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/main/acf-provisioning/acf-provisioning.post-upgrade b/main/acf-provisioning/acf-provisioning.post-upgrade index 089c448ac..53c8726cb 100644 --- a/main/acf-provisioning/acf-provisioning.post-upgrade +++ b/main/acf-provisioning/acf-provisioning.post-upgrade @@ -3,11 +3,25 @@ new=$1 old=$2 -# if current is not older than 0.0.8 we exit. -if ! [ "$(apk version -t $old 0.0.8)" = "<" ]; then - exit 0 +# 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 @@ -24,21 +38,14 @@ psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id 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 -# 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 +# if current is older than 0.0.9 we update. +if [ "$(apk version -t $old 0.0.9)" = "<" ]; then -exit 0 +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 + +exit 0 |