#!/bin/bash

cd /usr/local/bin/
for bin in donar measlat tor2 tor3 torecho udpecho; do
  wget https://gitlab.inria.fr/qdufour/donar/-/raw/master/dist/${bin}?inline=false -O ${bin}
  chmod +x ${bin}
done

for scr in donaralt donaraltna donaraltopt \
           donardup donardupna donardupopt \
           torfone torfonena torfoneopt \
           torhs torhsna torhsopt \
           tor1wcli tor2wcli; do
  wget https://gitlab.inria.fr/qdufour/donar/-/raw/master/scripts/2021/${scr}?inline=false -O ${scr}
  chmod +x ${scr}
done

cd /etc/systemd/system/
for svc in donaraltna@.service donaraltopt@.service donaralt@.service \
           donardupna@.service donardupopt@.service donardup@.service \
           torfonena@.service torfoneopt@.service torfone@.service \
           torhsna@.service torhsopt@.service torhs@.service \
           tor1wcli@.service tor1wserv.service tor2wcli@.service tor2wserv.service; do
  wget https://gitlab.inria.fr/qdufour/donar/-/raw/master/scripts/2021/${svc}?inline=false -O ${svc}
done

cd /root
for out in donaralt donaraltna donaraltopt \
           donardup donardupna donardupopt \
           torfone torfonena torfoneopt \
           torhs torhsna torhsopt \
           tor1w tor2w; do
  mkdir ${out}
done
