| 12345678910111213141516 |
- #!/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\""
|