diff --git a/lib/facter/eypconf_magic_hash.rb b/lib/facter/eypconf_magic_hash.rb index 8377f60..6935bc0 100644 --- a/lib/facter/eypconf_magic_hash.rb +++ b/lib/facter/eypconf_magic_hash.rb @@ -1,4 +1,8 @@ -magichash = Facter::Util::Resolution.exec('bash -c \'if [ -f /opt/eypconf/id/.magic ]; then cat /opt/eypconf/id/.magic | paste -sd,; else echo "deadbeef"; fi\'').to_s +if File.exists?('/opt/eypconf/id/magic.sh') then + magichash = Facter::Util::Resolution.exec('bash /opt/eypconf/id/magic.sh').to_s +else + magichash = Facter::Util::Resolution.exec('bash -c \'if [ -f /opt/eypconf/id/.magic ]; then cat /opt/eypconf/id/.magic | paste -sd,; else echo "deadbeef"; fi\'').to_s +end unless magichash.nil? or magichash.empty? Facter.add('eypconf_magic_hash') do diff --git a/lib/facter/eypconf_userid.rb b/lib/facter/eypconf_userid.rb index c884896..97c3e71 100644 --- a/lib/facter/eypconf_userid.rb +++ b/lib/facter/eypconf_userid.rb @@ -1,4 +1,8 @@ -userid = Facter::Util::Resolution.exec('bash -c \'if [ -f /opt/eypconf/id/customer ]; then cat /opt/eypconf/id/customer | paste -sd,; else echo "defaultcustomer"; fi\'').to_s +if File.exists?('/opt/eypconf/id/userid.sh') then + userid = Facter::Util::Resolution.exec('bash /opt/eypconf/id/userid.sh').to_s +else + userid = Facter::Util::Resolution.exec('bash -c \'if [ -f /opt/eypconf/id/userid ]; then cat /opt/eypconf/id/userid | paste -sd,; fi\'').to_s +end unless userid.nil? or userid.empty? Facter.add('eypconf_userid') do