]> git.openstreetmap.org Git - chef.git/blob - cookbooks/planet/templates/default/users-deleted.erb
Merge remote-tracking branch 'github/pull/183'
[chef.git] / cookbooks / planet / templates / default / users-deleted.erb
1 #!/bin/sh
2
3 # DO NOT EDIT - This file is being maintained by Chef
4
5 T=$(mktemp -d -t -p /var/tmp users.XXXXXXXXXX)
6
7 # use the same as for the users-agreed template
8 export PGPASSFILE=/etc/replication/users-agreed.conf
9
10 echo "# user IDs of deleted users. " > $T/users_deleted
11 psql -h <%= node[:web][:readonly_database_host] %> -U planetdiff -t -c "select id from users where status='deleted' order by id asc" openstreetmap >> $T/users_deleted
12
13 if cmp -s "${T}/users_deleted" "/store/planet/users_deleted/users_deleted.txt"; then
14   : # do nothing
15 else
16   cp $T/users_deleted /store/planet/users_deleted/users_deleted.txt
17 fi
18
19 rm -rf $T