samba.sh add read-only check to timezone

This commit is contained in:
David Personette 2016-02-28 10:07:53 -05:00
parent 753d2e6b20
commit 25747dc441

View File

@ -65,7 +65,7 @@ timezone() { local timezone="${1:-EST5EDT}"
return return
} }
if [[ $(cat /etc/timezone) != $timezone ]]; then if [[ -w /etc/timezone && $(cat /etc/timezone) != $timezone ]]; then
echo "$timezone" >/etc/timezone echo "$timezone" >/etc/timezone
ln -sf /usr/share/zoneinfo/$timezone /etc/localtime ln -sf /usr/share/zoneinfo/$timezone /etc/localtime
dpkg-reconfigure -f noninteractive tzdata >/dev/null 2>&1 dpkg-reconfigure -f noninteractive tzdata >/dev/null 2>&1