diff options
author | Ted Trask <ttrask01@yahoo.com> | 2011-06-10 20:48:46 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2011-06-10 20:48:46 +0000 |
commit | 9cc634cf1091fdc8a056bbe0925145d56c6fca52 (patch) | |
tree | 353a39af4f42761b9918e93ad33a71b8c9421c68 /main/acf-provisioning/acf-provisioning.post-upgrade | |
parent | 7513eadf420e19fde3451af1355c7874d1dfe27b (diff) | |
download | aports-9cc634cf1091fdc8a056bbe0925145d56c6fca52.tar.bz2 aports-9cc634cf1091fdc8a056bbe0925145d56c6fca52.tar.xz |
main/acf-provisioning: upgrade to 0.0.8
Diffstat (limited to 'main/acf-provisioning/acf-provisioning.post-upgrade')
-rw-r--r-- | main/acf-provisioning/acf-provisioning.post-upgrade | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/main/acf-provisioning/acf-provisioning.post-upgrade b/main/acf-provisioning/acf-provisioning.post-upgrade index 035be21475..089c448acc 100644 --- a/main/acf-provisioning/acf-provisioning.post-upgrade +++ b/main/acf-provisioning/acf-provisioning.post-upgrade @@ -3,6 +3,27 @@ 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 +fi + +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 + # if current is not older than 0.0.7-r1 we exit. if ! [ "$(apk version -t $old 0.0.7-r1)" = "<" ]; then exit 0 |