Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 449B

1234567891011121314151617181920212223242526272829
  1. 'use strict';
  2. const fs = require('fs');
  3. let isDocker;
  4. function hasDockerEnv() {
  5. try {
  6. fs.statSync('/.dockerenv');
  7. return true;
  8. } catch (_) {
  9. return false;
  10. }
  11. }
  12. function hasDockerCGroup() {
  13. try {
  14. return fs.readFileSync('/proc/self/cgroup', 'utf8').includes('docker');
  15. } catch (_) {
  16. return false;
  17. }
  18. }
  19. module.exports = () => {
  20. if (isDocker === undefined) {
  21. isDocker = hasDockerEnv() || hasDockerCGroup();
  22. }
  23. return isDocker;
  24. };