add sudo access to group cloud-builds
[mirror/dsa-puppet.git] / modules / roles / files / static-mirroring / static-update-component
index 27b9318..455d17d 100755 (executable)
@@ -27,6 +27,11 @@ usage() {
 }
 
 componentlist=/etc/static-components.conf
+. /etc/staticsync.conf
+if ! [ -n "$staticuser" ]; then
+  echo >&2 "staticuser not configured!"
+  exit 1
+fi
 
 if [ "$#" = 1 ]; then
   component="$1"
@@ -72,10 +77,10 @@ if [ "$srchost" = "$thishost" ] && ! [ -d "$srcdir" ]; then
   exit 1
 fi
 
-if [ "`id -nu`" != "staticsync" ]; then
-  sudo -u staticsync static-update-component "$@"
+if [ "`id -nu`" != "$staticuser" ]; then
+  sudo -u "$staticuser" static-update-component "$@"
 else
-  ssh -o AddressFamily=inet -t -o ServerAliveInterval=300 -o PreferredAuthentications=publickey "$masterhost" static-master-update-component "$component"
+  ssh -o AddressFamily=inet -t -t -o ServerAliveInterval=300 -o PreferredAuthentications=publickey "$masterhost" static-master-update-component "$component"
 fi
 
 # vim:set et: