Ahh, so the reference is the three letters which denote the timezone rather than the difference between the local time and GMT?
Thats interesting. Is there a list of the timezone denotations around ? I need to work them into this script
#!/bin/sh
#Written by Nickjf20 for [remaster]+ (C) 2011
ESC_SEQ="\x1b["
RESET=$ESC_SEQ"39;49;00m"
RED=$ESC_SEQ"31;01m"
GREEN=$ESC_SEQ"32;01m"
YELLOW=$ESC_SEQ"33;01m"
BLUE=$ESC_SEQ"34;01m"
MAGENTA=$ESC_SEQ"35;01m"
CYAN=$ESC_SEQ"36;01m"
if [ "$(id -u)" == "0" ]; then
echo -e "Please do not use sudo."
exit 1
fi
clear
echo -e "\n\nLocating [remaster]+ grub directory..."
GRUB_DIR=`find /mnt -maxdepth 3 -type d -name grub`
if [ -z "$GRUB_DIR" ]; then
echo -e "Grub directory not found. Is [remaster]+ installed?"
exit 1
else
echo -e "Grub Directory: $GRUB_DIR"
fi
echo -e "\n\nLocating time.sh config"
time_check=`find /home -maxdepth 3 -type f -name time.config`
if [ -z "$time_check" ]; then
echo "run once" >> time.config
echo "/usr/local/etc/chrony" >> /opt/.filetool.lst
else
echo -e "time.config present"
fi
re_run=`cat time.config`
if [ "$re_run" == "run once = true" ]; then
echo -e "${RED}We notice you have run this script before${RESET}"
echo -e "${BLUE}Are you sure you want to change settings?${RESET}"
echo -e "\n${BLUE}Press any key to continue...${RESET}"
echo -e "${RED}Press ctrl+c to quit setup${RESET}"
read -p ""
fi
tce-load -w -i chrony.tcz
clear
if [ "$re_run" == "run once" ]; then
echo -e "${YELLOW}Internet Updating${RESET}\n"
echo -e "${BLUE}Your [remaster]+ installation will connect to the internet"
echo -e "every boot to obtain the correct time${RESET}\n"
echo -e "${BLUE}This is broken into two steps:${RESET}"
echo -e "${MAGENTA}1) ${RESET}${GREEN}Selecting TimeZone${RESET}"
echo -e "${MAGENTA}2) ${RESET}${GREEN}Opting to use DST ${RED}(reccomended)${RESET}"
echo -e "\n${BLUE}Press any key to continue...${RESET}"
echo -e "${RED}Press ctrl+c to quit setup${RESET}"
read -p ""
clear
fi
echo -e "${YELLOW}Internet Clock${RESET}\n"
echo -e "${BLUE}To complete the installation and to recieve internet time in [remaster]+,"
echo -e "you must choose your ${GREEN}time zone.${RESET}\n"
echo -e "\n${MAGENTA}1) ${RESET}${BLUE}Are you in ${RED}UTC / GMT ${BLUE}time? [y]/n${RESET}"
read GMT
if [ -z "$GMT" ]; then
GMT="y"
fi
if [ "$GMT" == "y" ]; then
echo -e "\n${BLUE}You have set your ${GREEN}timezone!${RESET}"
time_zone=+0
fi
if [ "$GMT" == "n" ]; then
echo -e "\n${BLUE}Please select your${RESET} ${GREEN}timezone.${RESET}"
echo -e "${YELLOW}i.e. '+4' or '-6' e.t.c...${RESET}"
read time_zone
echo -e "\n${BLUE}You have set your ${GREEN}timezone ${BLUE}to${RESET}"
echo -e "${RED}GMT${time_zone}${RESET}"
fi
clear
echo -e "${YELLOW}Daylight Savings${RESET}\n"
echo -e "${BLUE}To complete the installation and to recieve internet time in [remaster]+,"
echo -e "you must decide whether you want${RESET}"
echo -e "\n${MAGENTA}2) ${RESET}${RED}Automatic ${YELLOW}Daylight Savings!${BLUE} [y]/n${RESET}"
echo -e "\n${BLUE}[remaster]+ DST will kick in on the second of March and will last till the first of November${RESET}"
read DST
if [ -z "$DST" ]; then
DST="y"
fi
if [ "$DST" == "y" ]; then
echo -e "\n${BLUE}You have turned${RESET} ${GREEN}DST${RESET}"
echo -e "${RED}ON${RESET}\n"
DST_STATE=ON
sed -i "s|kernel /boot/bzImage text quiet.*|kernel /boot/bzImage text quiet tz=UTC${time_zone}DST,M3.2.0/2,M11.1.0/2|" ${GRUB_DIR}/menu.lst
sed -i "s|run once.*|run once = true|" time.config
wait 2
fi
if [ "$DST" == "n" ]; then
echo -e "\n${BLUE}You have turned${RESET} ${GREEN}DST${RESET}"
echo -e "${RED}OFF${RESET}"
DST_STATE=OFF
sed -i "s|kernel /boot/bzImage text quiet.*|kernel /boot/bzImage text quiet tz=UTC${time_zone}|" ${GRUB_DIR}/menu.lst
sed -i "s|run once.*|run once = true|" time.config
wait 2
fi
clear
echo -e "${CYAN}Setup Complete${RESET}\n"
echo -e "${BLUE}GMT${RED}${time_zone}${RESET}"
echo -e "${BLUE}DST ${RED}${DST_STATE}${RESET}\n"
echo -e "${GREEN}Please run sudo ./90_reboot_sudo.sh to finalize the installation.${RESET}\n"
echo -e "${BLUE}Changes will ${RED}not ${BLUE}be instant on startup as${RESET}"
echo -e "${BLUE}it takes several seconds to download time data${RESET}\n"
exit