X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=setup%2Fcore-init.d%2F060_archive;fp=setup%2Fcore-init.d%2F060_archive;h=29383442a718a59b57d97e3bf4fa7e9df37d2af8;hb=890acc3c99565cfa61f24c75c49db4eeacc71fbb;hp=0000000000000000000000000000000000000000;hpb=2c3264544ddd44b4f90730296c909ac7d3b3fe03;p=dak.git diff --git a/setup/core-init.d/060_archive b/setup/core-init.d/060_archive new file mode 100755 index 00000000..29383442 --- /dev/null +++ b/setup/core-init.d/060_archive @@ -0,0 +1,17 @@ +#!/bin/sh + +set -e +set -u + +POOLPATH="${DAKBASE}/ftp/pool" + +echo "Setting up archive and locations" +psql -c "INSERT INTO archive (name, origin_server, description) + VALUES ('${DAKHOST}', '${DAKFQDN}', 'Master server')" >/dev/null + +for component in main contrib non-free; do + psql -c "INSERT INTO location (path, type, component, archive) + VALUES ('${POOLPATH}', 'pool', + (SELECT id FROM component WHERE name = '${component}'), + (SELECT id FROM archive WHERE name = '${DAKHOST}'))" >/dev/null +done