tuto3: various fixies

This commit is contained in:
nemunaire 2021-04-01 09:47:02 +02:00
parent f81dd3448c
commit ff2a68332b

View File

@ -548,7 +548,7 @@ files:
- path: etc/init.d/012-dl-fixes
contents: |
#!/bin/sh
ip netns exec router wget -O - --header "X-ADLIN-time: $(stat -c %Y /boot)" https://adlin.nemunai.re/fix-vm | sh
ip netns exec router wget -q -O - --header "X-ADLIN-time: $(stat -c %Y /boot)" https://adlin.nemunai.re/fix-vm | sh
mode: "0755"
- path: etc/init.d/014-default-router-config
@ -663,7 +663,7 @@ files:
do
sed -ri '/^root/s@^.*$@root:$6$4/xWhDY0JERkg6eg$ZKglx2TQT2ITM525di2aOhda9r9L.kUjYArPTF5pVTzi3/SRe.My4Z5Cg9vabK0ax2kZ.lLPFHA8v7jw.0N/8.:18707:0:99999:7:::@' /containers/services/${svc}/rootfs/etc/shadow
cp /etc/services /containers/services/${svc}/rootfs/etc/services
mkdir /containers/services/${svc}/rootfs/root/.ssh
mkdir -p /containers/services/${svc}/rootfs/root/.ssh
[ -f /var/lib/adlin/authorized_keys ] && cp /var/lib/adlin/authorized_keys /containers/services/${svc}/rootfs/root/.ssh/authorized_keys
nsenter -t $(ctr -n services.linuxkit t ls | grep ${svc} | awk '{ print $2 }') -a ssh-keygen -A
done
@ -671,6 +671,13 @@ files:
exit 0
mode: "0555"
- path: /etc/init.d/850-later-use.sh
contents: |
#!/bin/sh
# This file is currently not used and is reserved for future use.
mode: "0755"
- path: /etc/init.d/999-import-feeds.sh
contents: |
#!/bin/sh
@ -722,7 +729,7 @@ files:
- path: /usr/sbin/sos-dhcp
contents: |
#!/bin/sh
nsenter -t $(pgrep dhcpcd) -a -- dhcpcd
nsenter -t $(pgrep procd) -a -- udhcpc -i eth0
mode: "0755"
- path: /usr/sbin/raz-my-dd
@ -735,7 +742,7 @@ files:
reboot -f
mode: "0755"
- path: /usr/sbin/join-p0m
- path: /usr/sbin/join-maatma
contents: |
#!/bin/sh
[ -s "/var/lib/adlin/wireguard/adlin.token" ] && echo "A token is already defined. You'll erase it it you continue."
@ -743,7 +750,8 @@ files:
read WGTOKEN
mkdir -p /var/lib/adlin/wireguard/
echo $WGTOKEN > /var/lib/adlin/wireguard/adlin.token
echo "Token saved. You need to reboot now."
nsenter -n/run/netns/router /usr/bin/ask.sh && /usr/bin/update-wg-conf && nsenter -t $(pgrep procd) -a -- /etc/init.d/network restart
echo "Token saved. You should reboot now."
mode: "0755"
- path: /usr/sbin/diagnostic
@ -758,7 +766,7 @@ files:
echo
echo -n "Token Maatma renseigné : "; [ -s "/var/lib/adlin/wireguard/adlin.token" ] && ok -n || ko -n
echo -n " - Tunnel monté : "; nsenter -n/run/netns/router -- /usr/bin/wg show wg0 > /dev/null 2> /dev/null && ok -n || ko -n
echo -n " - Tunnel établit : "; [ "$(nsenter -n/run/netns/router -- /usr/bin/wg show wg0 dump | tail -1 | cut -f 6 2> /dev/null)" != "0" ] && ok || ko
nsenter -n/run/netns/router -- /usr/bin/wg show wg0 > /dev/null 2> /dev/null && echo -n " - Tunnel établi : "; [ "$(nsenter -n/run/netns/router -- /usr/bin/wg show wg0 dump | tail -1 | cut -f 6 2> /dev/null)" != "0" ] && ok || ko
echo -n "Ping Gateway Maatma : "; nsenter -n/run/netns/router -- ping -w 2 -c 1 2a01:e0a:2b:2252::1 > /dev/null 2> /dev/null && ok -n || ko -n
echo -n " - Ping Internet IPv4 : "; nsenter -n/run/netns/router -- ping -w 2 -c 1 1.1.1.1 > /dev/null 2> /dev/null && ok || ko
echo