Remove the pkglist fact. It's a) unused and b) slightly buggy
[mirror/dsa-puppet.git] / modules / roles / files / static-mirroring / static-update-component
index f8ca81e..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,8 +77,8 @@ 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 -t -o ServerAliveInterval=300 -o PreferredAuthentications=publickey "$masterhost" static-master-update-component "$component"
 fi