upgrade-session.sh 1.71 KB
Newer Older
1
#!/bin/bash
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

# Copyright (C) 2018  Tetras Libre <Contact@Tetras-Libre.fr>
# Author: Beniamine, David <David.Beniamine@Tetras-Libre.fr>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

19 20 21
logfile="/var/log/`basename $0`_`date +%Y%m%d-%H%M`"
exec &> >(tee -a "$logfile")

22
DIR=`dirname $0`
David Beniamine's avatar
David Beniamine committed
23 24 25 26 27
run_script(){
    echo "Running $1"
    $DIR/$1
    echo "Done $1 $?"
} 
28 29 30 31 32 33 34 35

if [ ! -z "$1" ] && [ "$1" == "apt" ]
then
    apt-get update
    apt-get upgrade -y
fi


36
cp "$DIR/fond admin.png" /home/administrateur/Documents/
37

David Beniamine's avatar
David Beniamine committed
38
cp $DIR/conky.conf /etc/conky/
39
cp $DIR/session.sh /usr/local/bin/
David Beniamine's avatar
David Beniamine committed
40 41 42 43 44 45 46 47 48 49 50
run_script add_session_script.sh
run_script create_cifs_mounts.sh
run_script set_mime_apps.sh
run_script set_screens.sh
run_script install_print_drivers.sh
run_script fix_libreoffice.sh
run_script install_vnc.sh
run_script install_conky.sh
run_script upgrade_repository.sh
run_script fix_xscreensaver.sh
run_script fix_pcmanfm.sh
51

52 53
if [ ! -e /etc/primtux-version ]
then
David Beniamine's avatar
David Beniamine committed
54
    run_script migrate_to_primtux4.sh
55 56
fi

David Beniamine's avatar
David Beniamine committed
57
# Install missing libreoffice gtk
58
if [ -z "`dpkg -l | grep libreoffice-gtk`" ]
David Beniamine's avatar
David Beniamine committed
59 60 61 62
then
    apt-get install -y libreoffice-gtk
fi

David Beniamine's avatar
David Beniamine committed
63 64
if [ $(who | wc -l) -eq 1 ]
then
65
    echo poweroff
David Beniamine's avatar
David Beniamine committed
66
fi