-
Notifications
You must be signed in to change notification settings - Fork 2
/
finalize.sh
executable file
·67 lines (48 loc) · 1.42 KB
/
finalize.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
#check we are root
if [ "$USER" != "root" ]; then
echo "Script must be run as root"
exit 1
fi
#fix rights
chown -R pi:pi /home/pi
chown -R root:root /lib/systemd/system/
chmod 644 /lib/systemd/system/systemd-udevd.service
chown -R root:root /etc/udev/rules.d/
chmod 644 /etc/udev/rules.d/11-usb-mount-drive.rules
#fix binaries right
if [ -f /usr/local/bin/expand.sh ]; then
chmod +x /usr/local/bin/expand.sh
fi
if [ -f /usr/local/bin/defaultvolume.sh ]; then
chmod +x /usr/local/bin/defaultvolume.sh
fi
if [ -f /usr/local/bin/waitforsoundcard.sh ]; then
chmod +x /usr/local/bin/waitforsoundcard.sh
fi
#enable custom services here
if [ -f /etc/systemd/system/pulseaudio.service ]; then
systemctl enable pulseaudio.service
fi
if [ -f /etc/systemd/system/pulseaudio.service ]; then
systemctl enable linto-client.service
fi
#enable ssh . Important since raspbian update 11-2016, disabled by default !!!
if [ -f /etc/systemd/system/sshd.service ]; then
systemctl enable ssh.service
fi
systemctl daemon-reload
#delete swap
apt-get remove dphys-swapfile
rm -f /var/swap
#change pi user password
whiptail --msgbox "You will now be asked to enter a new password for the pi user" 20 60 1
passwd pi &&
whiptail --msgbox "Password changed successfully" 20 60 1
#set time fuse
dpkg-reconfigure tzdata
#set locale
dpkg-reconfigure locales
#set keyboard
dpkg-reconfigure console-data
dpkg-reconfigure keyboard-configuration