Files
xteve_lazystream/root/etc/cont-init.d/50-update-hosts
taylorbourne 1e6334d7bd feat: make lazy stream host name configurable (#72)
* run raw plex curl request

* update sample env file

* parse raw chrome curl req

* update cronjob

* use post request to update plex

* oops

* feat: make lazystream host configurable

* feat: update xml template

* fix: revert plex update changes for now (needs more testing)

* feat: update readme
2021-11-03 17:03:49 -07:00

33 lines
768 B
Plaintext

#!/usr/bin/with-contenv bash
function prepend() {
while read line;
do echo "${1}${line}";
done;
}
exec 1> >(prepend "[update-hosts] ")
# Update hosts file
export IP=$(getent ahostsv4 "$lazyStreamHost" | awk '{ print $1 }' | head -1)
echo $IP playback.svcs.mlb.com >> /etc/hosts
echo $IP mf.svc.nhl.com >> /etc/hosts
echo $IP mlb-ws-mf.media.mlb.com >> /etc/hosts
cat /etc/hosts
# Update certs
rm -f /home/abc/.gnutls/known_hosts
rm -f /root/.gnutls/known_hosts
printf 'y\n' | gnutls-cli --tofu playback.svcs.mlb.com:443
printf 'y\n' | gnutls-cli --tofu mf.svc.nhl.com:443
printf 'y\n' | gnutls-cli --tofu mlb-ws-mf.media.mlb.com:443
install -D /root/.gnutls/known_hosts /home/abc/.gnutls/known_hosts
rm -rf /root/.gnutls
cat /home/abc/.gnutls/known_hosts