| 1 | [Unit] |
| 2 | Description=Sockgit Listen Server |
| 3 | After=network.target sockgit-listen.socket |
| 4 | Requires=sockgit-listen.socket |
| 5 | |
| 6 | [Service] |
| 7 | Type=oneshot |
| 8 | User=git |
| 9 | Group=git |
| 10 | WorkingDirectory=/srv/git |
| 11 | ExecStart=/bin/bash -c 'while read REPO; do /usr/bin/git init --bare --shared $REPO.git && cd $REPO.git && /usr/bin/git remote add public $USER@$PUBLIC:$PATH/$REPO.git; done;' |
| 12 | StandardInput=socket |
| 13 | StandardOutput=syslog |
| 14 | StandardError=syslog |
| 15 | Environment="USER=git" |
| 16 | Environment="PUBLIC=add your url" |
| 17 | Environment="PATH=/srv/git" |
| 18 | Environment="GIT_TEMPLATE_DIR=/usr/share/sockgit/templates" |
| 19 | |
| 20 | [Install] |
| 21 | WantedBy=multi-user.target |