import { Meteor } from 'meteor/meteor';
import { ServiceConfiguration } from 'meteor/service-configuration';

const externalServices = Meteor.settings.private.externalServices;

if (externalServices) {
  Object.keys(externalServices).forEach((service) => {
    ServiceConfiguration.configurations.upsert(
      { service },
      { $set: externalServices[service] },
    );
  });
}

@@ -250,16 +250,114 @@
 e) =%3E %7B%0A
+    if (externalServices%5Bservice%5D.clientId !== '' %7C%7C externalServices%5Bservice%5D.secret !== '') %7B%0A  
     Serv
@@ -402,16 +402,18 @@
 (%0A      
+  
 %7B servic
@@ -423,16 +423,18 @@
 ,%0A      
+ 
+ 
 %7B $set: 
@@ -466,15 +466,23 @@
  %7D,%0A
+  
     );%0A
+    %7D%0A
   %7D)

Update startup server accounts externalServices, with checks before upsert service configuration