src/init/break-in/do-breakin
changeset 39 f5055ce263c7
parent 38 f1ee930c4ba8
child 40 abbb822779da
equal deleted inserted replaced
38:f1ee930c4ba8 39:f5055ce263c7
     1 #!/bin/sh
       
     2 
       
     3 set -e
       
     4 
       
     5 HOME=~hg
       
     6 export HOME
       
     7 cd
       
     8 
       
     9 rm -rf temporary-breakin-repo
       
    10 mkdir temporary-breakin-repo
       
    11 cd temporary-breakin-repo
       
    12 hg clone ~/repos/hgadmin .
       
    13 if [ $(echo *) != "" ] ; then
       
    14  DIRNAME=retry
       
    15   while [ $DIRNAME = retry ] ; do
       
    16     DIRNAME=$(date -u +"%F_%T.%N")
       
    17     mkdir $DIRNAME || DIRNAME=retry
       
    18   done
       
    19   hg mv * $DIRNAME
       
    20   hg mv -f $DIRNAME old
       
    21 fi
       
    22 hg echo "init user=initkey" > hg-ssh-access.conf
       
    23 mkdir keys
       
    24 cat > keys/initkey
       
    25 hg add hg-ssh-access.conf keys/initkey
       
    26 hg commit -m "Reset access to a single key via break-in script"
       
    27 SSH_ORIGINAL_COMMAND= /etc/mercurial-server/hg-ssh-wrapper root
       
    28