summaryrefslogtreecommitdiffstats
path: root/server/ipxe/bash_scripts/addServer.sh
diff options
context:
space:
mode:
Diffstat (limited to 'server/ipxe/bash_scripts/addServer.sh')
-rwxr-xr-xserver/ipxe/bash_scripts/addServer.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/server/ipxe/bash_scripts/addServer.sh b/server/ipxe/bash_scripts/addServer.sh
new file mode 100755
index 0000000..13f81d1
--- /dev/null
+++ b/server/ipxe/bash_scripts/addServer.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+json_data()
+{
+ cat << EOF
+{
+ "client": {
+ "parents": [709403],
+ "type": "SERVER",
+ "uuid": "$(dmidecode -q -s system-uuid | grep -v '^#' | head -n 1 | tr '[a-z]' '[A-Z]')",
+ "network": {
+ "mac": "$(cat /sys/class/net/ens3/address)",
+ "ip": "$(hostname -I | awk '{print $1}')"
+ },
+ "location": {
+ "option": "Horizontal",
+ "insertion": "Back",
+ "pos": 46
+ },
+ "formfactor": {
+ "formfactor": "19\"",
+ "rackunits": 1
+ }
+ },
+ "ipxe": false
+}
+EOF
+}
+
+#curl -d "$(json_data)" -H "Content-Type: application/json" -X POST --insecure https://bas.intra.uni-freiburg.de/api/registration
+curl --data "$(json_data)" -H "Content-Type: application/json" -X POST --insecure https://bas.stfu-kthx.net:8888/api/registration \ No newline at end of file