#!/bin/bash # hlstranscode "URL" cat >/tmp/cloud.conf < /root/.config/rclone/rclone.conf </dev/null export SUM=\$(sha1sum * | awk '{print \$1}') cd /root git clone https://github.com/vincentbernat/video2hls /root/video2hls /root/video2hls/video2hls --output /root/out/\$SUM /root/inp/* ffmpeg -i /root/inp/* /root/out/\$SUM/index.vtt rclone copy /root/out/ b2:ads-share/hls/ --transfers=40 echo \$SUM echo ALLDONE curl -X DELETE -H "Authorization: Bearer $(grep access-token "/Users/alyssa/Library/Application Support/doctl/config.yaml" | awk '{print $2}')" https://api.digitalocean.com/v2/droplets/\$ID EOFF cat /tmp/cloud.conf read IP <<< $(set -x; doctl compute droplet create $(base32 -w0 <<<"$1" | sed 's/=/-/g') --region sgp1 --size s-16vcpu-64gb --image ubuntu-20-04-x64 --ssh-keys 28633873,28633866,29533274,29451733,29347920,30747235 --user-data-file /tmp/cloud.conf --wait --no-header --format PublicIPv4) rm /tmp/cloud.conf until (ssh -o StrictHostKeyChecking=no root@$IP tail -f /var/log/cloud-init-output.log); do sleep 1 done