Commit 7c10d4d6 authored by aTc's avatar aTc

configure some packages, create new user

parent 264accfa
......@@ -10,6 +10,6 @@ Vcs-Browser: http://dev.pyra-handheld.com/index.php/p/pyra-first-run/source/tree
Package: pyra-first-run
Architecture: all
Depends: ${misc:Depends} , pyra-wallpapers, zenity, hsetroot
Depends: ${misc:Depends} , pyra-wallpapers, zenity, hsetroot, libgnome2-perl
Description: Pyra first run scripts
Sets up user accounts, etc. on the first boot.
......@@ -4,7 +4,55 @@ export GTK2_RC_FILES=/usr/share/themes/Xfce/gtk-2.0/gtkrc
export WALLPAPER=/usr/share/pyra/wallpapers/official/pyra-a-720.png
hsetroot -cover $WALLPAPER
#xfwm4 &
zenity --question --title="Pyras Box has been opened." --text="Welcome!\n\nPyra's Box has been opened.\n\nThis wizard will help you setting up your $pnd_version OpenPyra handheld before the first use.\n\nYou will be asked a few simple questions to personalise and configure your device.\n\nDo you want to set up your unit now or shut the unit down and do it later?" --ok-label="Start now" --cancel-label="Shutdown"
# Setup the full name and username.
while ! name=$(zenity --title="Please enter your full name" --entry --text "Please enter your full name.") || [ "x$name" = "x" ] ; do
zenity --title="Error" --error --text="Please try again." --timeout 6
done
username_guess=$(echo "$name" | cut -d" " -f1 | tr A-Z a-z)
while ! username=$(zenity --title="Enter your username" --entry --text "Please choose a short username.\n\nIt should be all lowercase and contain only letters and numbers." --entry-text "$username_guess") || [ "x$username" = "x" ] ; do
zenity --title="Error" --error --text="Please try again." --timeout 6
done
while ! useradd -m --shell /bin/bash -c "$name,,," -G sudo,audio,bluetooth,plugdev "$username" ; do
username=$(zenity --title="Please check username" --entry --text "Please ensure that your username consists of only\nletters and numbers and is not already in use on the system." --entry-text "$username")
done
# ----
# Setup the users password.
password=""
while [ x$password = x ] ; do
password1=$(zenity --title=Password --entry --text="Please choose a new password." --hide-text)
password2=$(zenity --title=Confirm --entry --text="Confirm your new password." --hide-text)
if [ $password1 != $password2 ] ; then
zenity --title="Error" --error --text="The passwords do not match.\n\nPlease try again." --timeout 6
else
if [ x$password1 = x ] ; then
zenity --title="Error" --error --text="Password cannot be blank!\n\nPlease try again." --timeout 6
else
password=$password1
fi
fi
done
passwd "$username" <<EOF
$password
$password
EOF
# ----
dpkg-reconfigure -fgnome keyboard-configuration
dpkg-reconfigure -fgnome tzdata
dpkg-reconfigure -fgnome locales
zenity --info --text "Done!"
touch /var/lib/pyra/first-run.done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment