make_build_h 536 B

1234567891011121314151617181920
  1. #!/bin/sh
  2. HOSTNAME=`uname -n | sed 's/\\\\/\\\\\\\\/g'`
  3. KERNEL=`uname -r | sed 's/\\\\/\\\\\\\\/g'`
  4. MACHINE=`uname -m | sed 's/\\\\/\\\\\\\\/g'`
  5. OS=`uname -s`
  6. USER=`id | awk -F")" '{print $1}'| awk -F"(" '{print $2}' | sed 's/\\\\/\\\\\\\\/g'`
  7. DATE=`date -u "+%Y-%m-%d %H:%M:%S"`
  8. cat << END
  9. /*
  10. * build.h
  11. * Automatically generated
  12. */
  13. #define BUILD_HOSTNAME "${HOSTNAME}"
  14. #define BUILD_KERNEL "${KERNEL}"
  15. #define BUILD_MACHINE "${MACHINE}"
  16. #define BUILD_OS "${OS}"
  17. #define BUILD_DATE "${DATE} UTC"
  18. #define BUILD_USER "${USER}"
  19. END