break-in
changeset 32 4059dbe9f26a
parent 31 d54720d47ca2
equal deleted inserted replaced
31:d54720d47ca2 32:4059dbe9f26a
     1 #!/bin/sh
     1 #!/bin/sh
     2 
     2 
     3 set -e
     3 set -e
     4 
     4 
     5 REPO=~hg/repos/hgadmin
     5 user=$(whoami)
     6 sudo -u hg -H hg -q -R "$REPO" update null
       
     7 sudo -u hg mkdir $REPO/keys
       
     8 cp $1 $REPO/keys/root
       
     9 cd $REPO
       
    10 echo "init user=root" > hg-ssh-access.conf
       
    11 sudo -u hg -H /usr/local/lib/hg-admin-tools/refresh-auth ~/.ssh/authorized_keys /etc/hg-admin-tools/hg-ssh-wrapper
       
    12 
     6 
       
     7 /usr/local/lib/hg-admin-tools/create-breakin-repository
       
     8 cd hgadmin
       
     9 mkdir -p keys
       
    10 ssh-add -L > keys/$user
       
    11 echo "init user=$user" > hg-ssh-access.conf
       
    12 hg add keys/$user hg-ssh-access.conf
       
    13 hg commit -m "Give all access only to user $user"
       
    14 hg push