2022-10-21 15:01:55 +02:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2023-01-09 16:08:06 +01:00
|
|
|
GIT_URL="https://forge.chapril.org/pilpil/pilpil-client.git"
|
2022-10-21 15:01:55 +02:00
|
|
|
# dhcpcd.conf : Remove 2 last lines
|
2023-01-06 14:10:45 +01:00
|
|
|
sed -i "$(( $(wc -l < /etc/dhcpcd.conf) - 2 +1 )),$ d" /etc/dhcpcd.conf
|
2022-10-21 15:01:55 +02:00
|
|
|
# sshd_config : Remove 3 last lines
|
2023-01-06 14:10:45 +01:00
|
|
|
sed -i "$(( $(wc -l < /etc/ssh/sshd_config) - 3 +1 )),$ d" /etc/ssh/sshd_config
|
2022-10-21 15:01:55 +02:00
|
|
|
# wpa_supplicant.conf : subs SSID and PW
|
2023-01-06 14:10:45 +01:00
|
|
|
sed -i 's/\(ssid=\"\).*/\1pilpil\"/' /etc/wpa_supplicant/wpa_supplicant.conf
|
|
|
|
sed -i 's/\(psk=\"\).*/\1poilpoil\"/' /etc/wpa_supplicant/wpa_supplicant.conf
|
2023-01-09 16:08:06 +01:00
|
|
|
# Clear git/ssh credentials
|
|
|
|
#~ cd /home/pil/pilpil-client/
|
|
|
|
#~ git config --global --unset credential.helper
|
|
|
|
#~ git config --local --unset credential.helper
|
|
|
|
#~ git config --unset credential.helper
|
|
|
|
#~ rm /home/pil/.ssh/*
|
|
|
|
# sed -i "s:localgit:$GIT_URL:g" .git/config
|
2023-01-06 14:10:45 +01:00
|
|
|
# Empty a few folders
|
|
|
|
rm -rf /home/pil/.ssh/authorized_keys /home/pil/Videos/* /etc/ssl/private/nginx-selfsigned.key /etc/ssl/certs/nginx-selfsigned.crt
|
2022-10-21 17:45:22 +02:00
|
|
|
# Create dummy file in ~/Videos to reserve some space
|
|
|
|
dd if=/dev/zero of=/home/pil/Videos/remove_me bs=4MB count=100
|
2023-01-06 14:10:45 +01:00
|
|
|
# hostname : Change hostname
|
|
|
|
echo "pilpil" | sudo tee /etc/hostname
|
|
|
|
# hosts : Replace with hostname
|
|
|
|
sed -i 's/\(127.0.1.1\t\).*/\1pilpil/' /etc/hosts
|
2023-01-09 16:08:06 +01:00
|
|
|
|
|
|
|
#awk '{print $0" consoleblank=1"}' /boot/cmdline.txt
|