updated welcome_wizard

This commit is contained in:
Patrick McGuire
2021-11-11 16:54:25 -05:00
parent 3c7575cfd3
commit 3040bc4127
+38 -4
View File
@@ -19,11 +19,13 @@ overview() {
2) Setting your Language, Country, Timezone, Keyboard, and WiFi Country (if applicable) 2) Setting your Language, Country, Timezone, Keyboard, and WiFi Country (if applicable)
3) Connect to WiFi (if applicable) 3) Connect to WiFi (if applicable) / Set Date and Time (if applicable)
4) Changing the birdnet.conf configuration file to your needs 4) Set BirdNET-Pi's latitude and longitude
5) Updating the system to use your new birdnet.conf file" --no-wrap --icon-name=red-cardinal 5) Set the web interface and database passwords
6) Updating the system to use your new birdnet.conf file" --no-wrap --icon-name=red-cardinal
if [ $? -eq 0 ];then if [ $? -eq 0 ];then
exit 1 exit 1
@@ -59,12 +61,43 @@ change_locale() {
4) WiFi Country: Choose your country from the list" --no-wrap --icon-name=red-cardinal 4) WiFi Country: Choose your country from the list" --no-wrap --icon-name=red-cardinal
if [ $? -eq 1 ];then if [ $? -eq 1 ];then
get_latitude sync_clock
else else
change_password change_password
fi fi
} }
sync_clock() {
zenity --title="Connecting to WiFi/Setting the Date and Time" --window-icon=/usr/share/pixmaps/red-cardinal32.png \
--question --ok-label="Automatically" --cancel-label="Manually" --icon-name=red-cardinal --text="Should the installation update the date and time Automatically (using the internet),
or will you do this Manually?" --no-wrap
if [ $? -eq 1 ];then
get_date_and_time
else
setup_wifi
fi
}
get_date_and_time() {
full_date="$(zenity --forms --title="Set the current time" --window-icon=/usr/share/pixmaps/red-cardinal32.png --add-calendar=Calendar --add-combo="Current Hour (24h)" --combo-values="01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23" --add-combo="Current Minute" --combo-values="00|01|02|03|04|05|06|07|08|09|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" --add-combo="Current Second" --combo-values="00|01|02|03|04|05|06|07|08|09|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")"
current_date="$(echo ${full_date} | awk -F\| '{print $1}')"
if ! [ -z $current_date ];then
current_time="$(echo ${full_date} | awk -F\| '{print $1" "$2":"$3":"$4}')"
sudo date -s "${current_time}"
get_latitude
else
sync_clock
fi
}
setup_wifi() {
zenity --title="Connect to WiFi" --window-icon=/usr/share/pixmaps/red-cardinal32.png --info --text="Use the Networking Icon in the top right corner of
the screen to select your WiFi network. Enter the credentials to connect when prompted.
Press \"Continue\" after you have connected." --ok-label="Continue" --no-wrap
get_latitude
}
open_rpi_configuration() { open_rpi_configuration() {
if ! pgrep rc_gui;then if ! pgrep rc_gui;then
env SUDO_ASKPASS=/usr/lib/rc-gui/pwdrcg.sh sudo -AE rc_gui & env SUDO_ASKPASS=/usr/lib/rc-gui/pwdrcg.sh sudo -AE rc_gui &
@@ -118,3 +151,4 @@ set_db_pwd() {
overview overview
exit