Change cleanup operations order
This commit is contained in:
parent
feeecc44fd
commit
0546484df0
|
@ -1,17 +1,17 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# dhcpcd.conf : Remove 2 last lines
|
||||
sed -i "$(( $(wc -l < /etc/dhcpcd.conf) - 2 +1 )),$ d" /etc/dhcpcd.conf
|
||||
# sshd_config : Remove 3 last lines
|
||||
sed -i "$(( $(wc -l < /etc/ssh/sshd_config) - 3 +1 )),$ d" /etc/ssh/sshd_config
|
||||
# wpa_supplicant.conf : subs SSID and PW
|
||||
sed -i 's/\(ssid=\"\).*/\1pilpil\"/' /etc/wpa_supplicant/wpa_supplicant.conf
|
||||
sed -i 's/\(psk=\"\).*/\1poilpoil\"/' /etc/wpa_supplicant/wpa_supplicant.conf
|
||||
# Empty a few folders
|
||||
sudo rm -rf /home/pil/.ssh/authorized_keys /home/pil/Videos/* /etc/ssl/private/nginx-selfsigned.key /etc/ssl/certs/nginx-selfsigned.crt
|
||||
rm -rf /home/pil/.ssh/authorized_keys /home/pil/Videos/* /etc/ssl/private/nginx-selfsigned.key /etc/ssl/certs/nginx-selfsigned.crt
|
||||
# Create dummy file in ~/Videos to reserve some space
|
||||
dd if=/dev/zero of=/home/pil/Videos/remove_me bs=4MB count=100
|
||||
# hostname : Change hostname
|
||||
echo "pilpil" | sudo tee /etc/hostname
|
||||
# hosts : Replace with hostname
|
||||
sudo sed -i 's/\(127.0.1.1\t\).*/\1pilpil/' /etc/hosts
|
||||
# dhcpcd.conf : Remove 2 last lines
|
||||
sudo sed -i "$(( $(wc -l < /etc/dhcpcd.conf) - 2 +1 )),$ d" /etc/dhcpcd.conf
|
||||
# sshd_config : Remove 3 last lines
|
||||
sudo sed -i "$(( $(wc -l < /etc/ssh/sshd_config) - 3 +1 )),$ d" /etc/ssh/sshd_config
|
||||
# wpa_supplicant.conf : subs SSID and PW
|
||||
sudo sed -i 's/\(ssid=\"\).*/\1pilpil\"/' /etc/wpa_supplicant/wpa_supplicant.conf
|
||||
sudo sed -i 's/\(psk=\"\).*/\1poilpoil\"/' /etc/wpa_supplicant/wpa_supplicant.conf
|
||||
# Create dummy file in ~/Videos to reserve some space
|
||||
dd if=/dev/zero of=/home/pil/Videos/remove_me bs=4MB count=100
|
||||
sed -i 's/\(127.0.1.1\t\).*/\1pilpil/' /etc/hosts
|
||||
|
|
Loading…
Reference in New Issue