UCE Tricks

UCE

GDM

A /etc/gdm/PostSession es pot posar l’script de neteja

    rm -rf /home/alumne/
    mkdir /home/alumne
    cd /home/alumne
    tar zxvf ../configuracions.tar.gz
    cd ..
    chown -R alumne:alumne alumne/

Script

`` #!/bin/bash

#  Versio: 0.3
# 
# Aquest script transforma una instal┬Ělacio neta de ubuntu en un 
# ordinador de la UCE
#
# Autor: Fran Hermoso
#
# Us: ./uce.sh 192.168.1.5 [scp]



#El primer ordinador si el parametre scp esta posat
ORIGEN="192.168.1.15"

#Ordinador actual
DESTI="$1"
INTERFICIE_PRINCIPAL="eth0"
ROUTER="192.168.1.1"

#Paquets extra
ALTRES="language-pack-ca"

#Els repositoris
SERVIDOR="192.168.1.13"
DISTRO="jaunty"

# No tocar res d'aqui en avall

if [ $(whoami) != "root" ]
    then
        echo "Executa 'sudo -s' abans"
        exit 0
fi

# IP estatica
echo "auto lo $INTERFICIE_PRINCIPAL" > /etc/network/interfaces
echo "iface lo inet loopback" >> /etc/network/interfaces
echo "iface $INTERFICIE_PRINCIPAL inet static" >> /etc/network/interfaces
echo "address $DESTI" >> /etc/network/interfaces
echo "netmask 255.255.255.0" >> /etc/network/interfaces
echo "gateway $ROUTER" >> /etc/network/interfaces
echo "nameserver $ROUTER" > /etc/resolv.conf

/etc/init.d/networking restart


# Paquets
echo "Quan l'ordinador d'origen estigui llest, prem la tecla retorn"
read
mv /etc/apt/sources.list /etc/apt/sources.list.bak
echo "deb http://$SERVIDOR/ubuntu/ $DISTRO main restricted universe multiverse" > /etc/apt/sources.list
echo "deb http://$SERVIDOR/ubuntu/ $DISTRO-updates main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb http://$SERVIDOR/ubuntu/ $DISTRO-security main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb http://$SERVIDOR/ubuntu/ $DISTRO-backports main restricted universe multiverse" >> /etc/apt/sources.list

if [ $2 == "scp" ]
then
        echo "Inseriu el pass del origen"
    scp -r $ORIGEN:/var/cache/apt/archives/* /var/cache/apt/archives/
fi

apt-get update
apt-get dist-upgrade
apt-get install ubuntu-restricted-extras sun-java6-plugin vim openssh-server vlc $ALTRES
echo "premeu retorn per tornar a iniciar"
read
reboot

``

last updated on April 11, 2015, 7:40 p.m.
Back