This commit is contained in:
Patrick 2024-11-22 18:09:29 +01:00
parent 5bc8947251
commit dd33d487db
3 changed files with 16 additions and 1 deletions

11
data/dnsfix.sh Normal file
View file

@ -0,0 +1,11 @@
#!/bin/sh
if command -v pkexec >/dev/null 2>&1; then
pkexec sh -c "echo \"nameserver 192.168.16.1\" | tee /etc/resolv.conf >/dev/null && sudo chattr +i /etc/resolv.conf"
elif command -v sudo >/dev/null 2>&1; then
sudo sh -c "echo \"nameserver 192.168.16.1\" | tee /etc/resolv.conf >/dev/null && sudo chattr +i /etc/resolv.conf"
elif command -v doas >/dev/null 2>&1; then
doas sh -c "echo \"nameserver 192.168.16.1\" | tee /etc/resolv.conf >/dev/null && sudo chattr +i /etc/resolv.conf"
else
su -c "echo \"nameserver 192.168.16.1\" | tee /etc/resolv.conf >/dev/null && sudo chattr +i /etc/resolv.conf"
fi

View file

@ -11,7 +11,10 @@
<h1>Welcome to VM Experiments!</h1>
<p>Below you can download the required Certificate Authority.</p>
<p>You can import it on Firefox and in your operating system.</p>
<a href="ca.crt">Download Here!</a>
<a href="ca.crt">Download Certificate Here!</a>
<br>
<p>You can also download the DNS fix scriptlet here:</p>
<a href="dnsfix.tar">Download DNS Fix Here!</a>
</body>
</html>

View file

@ -10,4 +10,5 @@ sudo mkdir -p /var/www/html
sudo cp ../data/index.html /var/www/html/
sudo cp /root/ca.crt /var/www/html/
sudo cp ../data/default.conf /etc/nginx/sites-available/default
tar -cvf /var/www/html/script.tar ../data/script.sh
sudo systemctl restart nginx