Browse Source

'cron.sh' hinzufügen

Daniel Wenzel 3 years ago
parent
commit
0c5cd84969
1 changed files with 16 additions and 0 deletions
  1. 16 0
      cron.sh

+ 16 - 0
cron.sh

@@ -0,0 +1,16 @@
+#!/bin/bash
+
+NewLine='{"choices":"'
+HostLine=""
+RNLine='@'
+
+for HostGross in $(cat /opt/ona/etc/bind/zone_data/named-klenzel.net | egrep '^[a-zA-Z]{3}-[a-zA-Z]{2}-[a-zA-Z]{2}-[a-zA-Z]{4}' | grep -v "test" | cut -d "." -f1 | tr a-z A-Z| sort | uniq); do
+        HostKlein=$(echo $HostGross | tr A-Z a-z)
+        HostLine="${HostLine}${HostKlein}:${HostGross}${RNLine}"
+done
+
+AppendLine='","default":"","prompt":"","multiselect":true}'
+HostChoiceList="${NewLine}${HostLine}${AppendLine}"
+
+mysql --host=172.30.242.130 -u osticket --password='0z]/W0M*J]JMonz!' -D osticket -e "UPDATE ost_form_field SET configuration = '${HostChoiceList}' WHERE form_id = \"2\" AND label = \"Hostname\""
+mysql --host=172.30.242.130 -u osticket --password='0z]/W0M*J]JMonz!' -D osticket -e "UPDATE ost_form_field SET configuration = REPLACE(configuration, '@', '\\\r\\\n') WHERE form_id = \"2\" AND label = \"Hostname\""