]> git.donarmstrong.com Git - cran2deb.git/blobdiff - trunk/exec/cran2deb
sudo to cran2deb user prior to commands if not already user
[cran2deb.git] / trunk / exec / cran2deb
index 7efedc751a484296ff30eb77cc3ed568cebc6635..3b2794acf3ba570e3622072d037c1257e5a6cff1 100755 (executable)
@@ -7,4 +7,10 @@ if [ ! -x "$root/exec/$cmd" ]; then
     echo unknown command $cmd
     exit 1
 fi
-"$root/exec/$cmd" "$root" $*
+
+precmd=""
+if [ "$(id -un)" != c2d ]; then
+       precmd="sudo -u c2d -E"
+fi
+
+$precmd "$root/exec/$cmd" "$root" $*