User=git
Group=git
WorkingDirectory=/srv/git
-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;'
+ExecStart=/bin/bash -c '[ $REMOTE_ADDR == $WHITELIST_IP ] && 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;'
StandardInput=socket
StandardOutput=syslog
StandardError=syslog
Environment="PUBLIC=add your url"
Environment="PATH=/srv/git"
Environment="GIT_TEMPLATE_DIR=/usr/share/sockgit/templates"
+Environment="WHITELIST_IP=your ip"
[Install]
WantedBy=multi-user.target