asterisk/build_tools/make_build_h

21 lines
536 B
Plaintext
Raw Normal View History

2023-05-25 18:45:57 +00:00
#!/bin/sh
HOSTNAME=`uname -n | sed 's/\\\\/\\\\\\\\/g'`
KERNEL=`uname -r | sed 's/\\\\/\\\\\\\\/g'`
MACHINE=`uname -m | sed 's/\\\\/\\\\\\\\/g'`
OS=`uname -s`
USER=`id | awk -F")" '{print $1}'| awk -F"(" '{print $2}' | sed 's/\\\\/\\\\\\\\/g'`
DATE=`date -u "+%Y-%m-%d %H:%M:%S"`
cat << END
/*
* build.h
* Automatically generated
*/
#define BUILD_HOSTNAME "${HOSTNAME}"
#define BUILD_KERNEL "${KERNEL}"
#define BUILD_MACHINE "${MACHINE}"
#define BUILD_OS "${OS}"
#define BUILD_DATE "${DATE} UTC"
#define BUILD_USER "${USER}"
END