]> git.donarmstrong.com Git - neurodebian.git/blob - tools/nd-vmsetupwizard
Few fixes.
[neurodebian.git] / tools / nd-vmsetupwizard
1 #!/bin/bash
2 #emacs: -*- mode: shell-script; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
3 #ex: set sts=4 ts=4 sw=4 et:
4
5 # play save
6 set -e
7 set -u
8
9 cfg_dir=/etc/neurodebian/guest/setupwizard_done
10 success_flag=$cfg_dir/setupwizard_done
11 nd_icon=/usr/share/pixmaps/neurodebian.svg
12 icon_opt="--window-icon=$nd_icon"
13
14 first_run=0
15 if [ ! -e $success_flag ]; then
16         first_run=1
17 fi
18
19 if [ $first_run -eq 1 ]; then
20 zenity --info $icon_opt --title="NeuroDebian Setup Wizard" \
21        --text="Welcome to the NeuroDebian virtual machine!
22
23 This is the first time you have started this virtual machine. We will now perform a few simple steps to finalize its configuration. This includes upgrading the system to the latest available versions and installing additional software packages upon your request."
24 fi
25
26 if ! zenity --question $icon_opt --title="NeuroDebian Setup Wizard" \
27 --text="The setup procedure requires network access to download packages from the Debian archive. If you do not have network access right now, you can re-start this wizard at any time from the NeuroDebian menu.
28
29 Do you want to proceed with updating the system?
30 "; then
31         exit 0
32 fi
33
34 # initialize apt
35 update-manager -c
36
37 if [ ! -e /etc/popularity-contest.conf ]; then
38         zenity --info $icon_opt --title="NeuroDebian Setup Wizard" \
39                 --text="You will now be given the choice to participate in the package survey. If enabled, a list of installed packages will be anonymously sent to Debian (http://popcon.debian.org). Your participation is important for two reasons:
40
41 1) Popular packages receive more attention from developers, bugs are fixed faster and updates are provided quicker.
42 2) User statistics can help research software developers to acquire funding for continued development."
43
44         # install, but do not fail if something goes wrong
45         nd-autoinstall popularity-contest /etc/popularity-contest.conf || true
46 fi
47
48 # essential things are done -- let's mark sucess
49 if [ $first_run -eq 1 ]; then
50         sudo bash -c "mkdir -p $cfg_dir && touch $success_flag"
51 fi
52
53 packages=$(zenity --list --checklist --column="Install" --column="Description" \
54            --column="Package Name" --print-column=3 --hide-column=3 --hide-header \
55            --separator=' ' --text="This is the manual
56 " \
57 FALSE "one" "ipython" \
58 FALSE "two" "vim" \
59 FALSE "three" "bc dc" || true)
60
61 if [ -n "$packages" ]; then
62         nd-autoinstall -f -p "$packages" true
63 fi
64
65 # and start greeter
66 x-www-browser http://neuro.debian.net/vm_welcome.html &