From: Martin Pitt Date: Tue, 26 Feb 2013 08:07:49 +0000 (+0100) Subject: postinst-setup: stop restoring users from /etc bzr, set them up manually X-Git-Url: https://piware.de/gitweb/?a=commitdiff_plain;h=31d93a08cbf894bc37eed23e99c2ed03ad213ac2;p=bin.git postinst-setup: stop restoring users from /etc bzr, set them up manually --- diff --git a/postinst-setup b/postinst-setup index 6bc4f03..191bcf7 100755 --- a/postinst-setup +++ b/postinst-setup @@ -20,31 +20,14 @@ fi # completely cd /etc if [ ! -d /etc/.bzr ]; then - for i in passwd group shadow; do - [ -e $i.originst ] || cp $i $i.originst - done [ -e /backup-etc ] || bzr branch bzr+ssh://martin@piware.de/home/martin/backup/`hostname`-etc /backup-etc cp -av /backup-etc/* /etc/ cp -av /backup-etc/.bzr/ /etc/ rm -rf /backup-etc chmod 600 /etc/ssh/ssh_*_key - chmod 640 /etc/shadow - chown root:shadow /etc/shadow chmod 700 /etc/ssl/private chmod 640 /etc/ssl/private/ssl-cert-* chown root:ssl-cert /etc/ssl/private/ssl-cert* - - # only restore the human users from passwd/group - for i in passwd group; do - perl -naF: -e 'print if $F[2] > 1000 && $F[2] < 60000' $i >> $i.originst - mv $i.originst $i - done - - # only restore some passwords from shadow - egrep 'martin|netti|joe' shadow >> shadow.originst - mv shadow.originst shadow - chown root:shadow shadow - chmod 640 shadow fi # update postfix for new configuration @@ -74,6 +57,14 @@ rmdir /var/lib/schroot/unpack /var/lib/schroot/union/overlay/ ln -s /tmp /var/lib/schroot/unpack ln -s /tmp /var/lib/schroot/union/overlay +# set up users +echo "Setting up users" +adduser martin sbuild +if ! getent passwd joe > /dev/null; then + adduser --gecos "Joe" joe + adduser joe audio +fi + # crontabs crontab -u martin - <