diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-config b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-config index ec4c8fc..a3f9bca 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-config +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-config @@ -166,7 +166,7 @@ utilities() { while true; do local option="" option=$(dialog --cancel-label "Back" --menu "$title" 17 40 4 \ - 1 "Set system timezone" \ + 1 "Set system time" \ 2 "Kernel modules" \ 3 "Re-run first-boot script" \ 4 "Run USB configuration tool" \ @@ -183,7 +183,7 @@ utilities() { fi case $option in - 1) femto-set-timezone.sh ;; # set timezone) + 1) femto-set-time.sh ;; # set timezone) 2) # Kernel modules) dialog --title "$title" --msgbox "Kernel modules are loadable pieces of code that extend a Linux kernel's functionality without requiring a reboot. Common examples include device drivers, file systems, or system calls.\n\nThis tool will allow you to add pre-compiled modules to the Foxbuntu kernel.\n\nModules currently autostarting at boot: $(modules=$(sed -n '6,$p' /etc/modules | sed ':a;N;$!ba;s/\n/, /g;s/, $//'); [ -z "$modules" ] && echo "none" || echo "$modules")\n\nCurrently active modules: $(lsmod | awk 'NR>1 {print $1}' | tr '\n' ' ')" 18 65 femto-kernel-modules.sh diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-install-wizard.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-install-wizard.sh index fcd98e7..567a4c5 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-install-wizard.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-install-wizard.sh @@ -19,7 +19,7 @@ title="Install Wizard" wizard() { - femto-set-timezone.sh + femto-set-time.sh new_hostname=$(dialog --title "$title" --cancel-label "Skip" --inputbox "Enter hostname:" 8 40 $(hostname) 3>&1 1>&2 2>&3) if [ $? -eq 0 ]; then #unless cancel/no diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-set-time.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-set-time.sh new file mode 100644 index 0000000..c3b5129 --- /dev/null +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-set-time.sh @@ -0,0 +1,90 @@ +#!/bin/bash +export NCURSES_NO_UTF8_ACS=1 # prevents weirdness over tty + +if [[ $EUID -ne 0 ]]; then + echo -e "This script must be run as root. Try \`sudo femto-set-timezone\`." + exit 1 +fi + +arg_count=$# + +help=$(cat <&1 1>&2 2>&3) +exit_status=$? +if [[ $exit_status -eq 0 && -n "$selected_timezone" ]]; then + # Set the selected time zone + set_timezone $selected_timezone +else + exit 1 +fi + +DATE=$(echo "$(dialog --title "Select Date" --calendar "Choose a date:\nCurrent date: $(date "+%B %d, %Y")\nPress [TAB] to select." 0 0 $(date +%d) $(date +%m) $(date +%Y) 3>&1 1>&2 2>&3)" | awk -F/ '{printf "%04d-%02d-%02d", $3, $2, $1}') +if [ $? -eq 1 ]; then #if cancel/no + exit 1 +fi +TIME=$(dialog --title "Set Time" --timebox "Select time:\nCurrent time: $(date +%H:%M:%S)\nPress [TAB] to select." 0 0 3>&1 1>&2 2>&3) # Dialog timebox for time +if [ $? -eq 1 ]; then #if cancel/no + exit 1 +fi +if date -s "$DATE $TIME"; then # set time + if hwclock --systohc; then + rtc="New time successfully saved to RTC." + else + rtc="Unable to communicate with RTC module. An RTC module can save system time between reboots/power outages." + fi + log_message "System time updated to:\n$(date)\n\n$rtc\nTime & date are also set automatically from internet." +else + log_message "Failed to set system time." + exit 1 +fi \ No newline at end of file diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-set-timezone.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-set-timezone.sh deleted file mode 100755 index 35db638..0000000 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-set-timezone.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash -export NCURSES_NO_UTF8_ACS=1 # prevents weirdness over tty - -if [[ $EUID -ne 0 ]]; then - echo "This script must be run as root. Try \`sudo femto-set-timezone\`." - exit 1 -fi - -arg_count=$# - -help=$(cat <&1 1>&2 2>&3) -exit_status=$? -if [[ $exit_status -eq 0 && -n "$selected_timezone" ]]; then - # Set the selected time zone - set_timezone $selected_timezone -fi \ No newline at end of file diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-software.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-software.sh index 3d208bb..7c75d94 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-software.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-software.sh @@ -68,9 +68,9 @@ package_intro() { $(if $package_dir/$1.sh -O | grep -q 'A'; then echo -e "by $($package_dir/$1.sh -A)"; fi)\n\ $(if $package_dir/$1.sh -O | grep -q 'D'; then echo "\n$($package_dir/$1.sh -D)"; fi)\n\ \n\ -$(echo "Currently: " && $package_dir/$1.sh -I && echo "\Zuinstalled\Zn" || echo "\Zunot installed\Zn")\n\ -$(if output=$($package_dir/$1.sh -L); [ -n "$output" ]; then echo "Installs to: \Zu$output\Zn"; fi)\ -$(if output=$($package_dir/$1.sh -C); [ -n "$output" ]; then echo "Installs to: \Zu$output\Zn"; fi)\ +$(echo "Currently: " && $package_dir/$1.sh -I && echo "\Zuinstalled\Zn" || echo " \Zunot installed\Zn")\n\ +$(if output=$($package_dir/$1.sh -L); [ -n "$output" ]; then echo "Installs to: \Zu$output\Zn\n"; fi)\ +$(if output=$($package_dir/$1.sh -C); [ -n "$output" ]; then echo "Conflicts with: \Zu$output\Zn\n"; fi)\ An internet connection is required for installation.\n\ $(if $package_dir/$1.sh -O | grep -q 'U'; then echo "\nFor more information, visit $($package_dir/$1.sh -U)"; fi)" 0 0 package_menu $1 # after user hits "OK", move on to package menu diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-usb-config-tool.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-usb-config-tool.sh index 1328565..e76f999 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-usb-config-tool.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-usb-config-tool.sh @@ -204,7 +204,7 @@ if [ -f "$mount_point/femtofox-config.txt" ]; then if [[ -n "$timezone" ]]; then # set timezone timezone=$(echo "$timezone" | sed 's/\\//g') log_message "Updating system timezone to $timezone." - femto-set-timezone.sh -t "$timezone" + femto-set-time.sh -t "$timezone" found_config="true" fi