From 2d18912059d86be84090b0ccb2764868b6b90a3c Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 9 Mar 2022 01:56:28 +0000 Subject: Drop to user and re-exec --- scripts/git-mirror.cron | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/git-mirror.cron b/scripts/git-mirror.cron index 4dc385f..311180a 100755 --- a/scripts/git-mirror.cron +++ b/scripts/git-mirror.cron @@ -1,5 +1,7 @@ #!/bin/bash +[[ $(id -u) -eq 0 ]] && exec sudo -H -u randomdan $0 $@ + find /var/git -maxdepth 2 -name config -type f | \ xargs grep -F '[remote "github"]' -l | \ xargs dirname | \ -- cgit v1.2.3