summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-03-09 01:56:28 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2022-03-09 01:56:28 +0000
commit2d18912059d86be84090b0ccb2764868b6b90a3c (patch)
treedc468585d7ecd4c469d514058ae6bdc55c0a0b60 /scripts
parentAdd git-mirror.cron (diff)
downloadconfig-2d18912059d86be84090b0ccb2764868b6b90a3c.tar.bz2
config-2d18912059d86be84090b0ccb2764868b6b90a3c.tar.xz
config-2d18912059d86be84090b0ccb2764868b6b90a3c.zip
Drop to user and re-exec
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/git-mirror.cron2
1 files changed, 2 insertions, 0 deletions
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 | \