# 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
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 - <<EOF
# m h dom mon dow command