#!/bin/bash # This script will run once after a fresh installation LOG=/var/log/auto-install.log SERVER=http://www.panticz.de/pxe/scripts MAC=$(LANG=us_EN; ifconfig -a | head -1 | awk /HWaddr/'{print tolower($5)}') MAC_HASH=$(echo ${MAC} | md5sum | cut -d" " -f1) # todo # clear terminal from wrapped lines # clear terminal clear # default functions function script() { if [ ! -z $1 ]; then #URL=${SERVER}/$1 URL=http://dl.dropbox.com/u/4170695/scripts/$1 FILE=${URL##*/} wget -nv $URL -P /tmp chmod +x /tmp/$FILE /tmp/$FILE $2 2>&1 | tee -a ${LOG} fi } function script2() { if [ ! -z ${1} ]; then URL=http://www.panticz.de/sites/default/files/scripts/${1} wget -nv ${URL} -O /tmp/${1} chmod +x /tmp/${1} /tmp/${1} ${2} 2>&1 | tee -a ${LOG} fi } function script3() { if [ ! -z ${1} ]; then URL=http://installit.googlecode.com/hg/${1} FILE=${URL##*/} echo "URL:$URL" echo "FILE:$FILE" wget -nv ${URL} -O /tmp/${FILE} chmod +x /tmp/${FILE} bash /tmp/${FILE} ${2} 2>&1 | tee -a ${LOG} fi } # install function install() { echo "--- install $@ ---" >> ${LOG} apt-get install -y --force-yes $@ 2>&1 | tee -a ${LOG} } # create user function addUser() { USERNAME=$1 echo "--- addUser ($USERNAME)---" if [ ! -z $USERNAME ]; then useradd -m $USERNAME echo $USERNAME > /tmp/pw echo $USERNAME >> /tmp/pw passwd $USERNAME < /tmp/pw rm /tmp/pw fi } # # APPS # function install_ubuntu-restricted-extras() { script3 install.ubuntu-restricted-extras.sh } function install_skype() { script3 install.skype.sh } function install_boxee() { script install.boxee.txt } function install_openttd() { script install.openttd.txt } function install_wine() { script3 install.wine.sh } function install_hibiscus() { script install.hibiscus.txt } function install_dropbox() { script3 install.dropbox.sh } function install_acroread() { script3 install.acroread.sh } # # DEVELOPMENT # function install_sqldeveloper() { script3 install.sqldeveloper.sh http://fs/ubuntu/install/sqldeveloper-no-jre.zip $1 } function install_netbeans() { install_java-jdk script3 install.netbeans.sh } function install_eclipse() { script3 install.eclipse.sh } # # PRINTER # function install_Laser() { # get driver from kyocera homepage wget http://www.kyoceramita.de/dlc/de/driver/all/linux_ppd_s_ksl_8.-downloadcenteritem-Single-File.downloadcenteritem.tmp/Linux_PPDs_KSL8_4.zip -P /tmp/ unzip /tmp/Linux_PPDs_KSL8_4.zip -d /tmp sudo lpadmin -p Laser -v socket://192.168.1.11:9100 -E -P "/tmp/PPD's_KSL_8.4/English/Kyocera_Mita_FS-3820N_en.ppd" sudo lpadmin -p LaserColor -v socket://192.168.1.15:9100 -E -P "/tmp/PPD's_KSL_8.4/English/Kyocera_Mita_FS-C5016N_en.ppd" #Foomatic/hpijs-pcl5e # -o PageSize=A4 # install linux driver # foomatic-ppdfile -p "foomatic-ppdfile:Kyocera-FS-C5016N-Postscript.ppd" > /tmp/Kyocera-FS-C5016N-Postscript.ppd # lpadmin -p LaserColorOben -v socket://192.168.1.11:9100 -E -P /tmp/Kyocera-FS-C5016N-Postscript.ppd -o PageSize=A4 } function install_EpsonColor() { wget http://installit.googlecode.com/hg/hardware/install.epson.b-500dn.sh -O - | bash - sudo lpadmin -p EpsonOben -v socket://EpsonOben:2501 -E -P /usr/share/cups/model/ekb500dn.ppd # -o DefaultInputSlot=Front # lpoptions -p EpsonColor -o MediaType=PLAIN -o PageSize=A5 } function install_Kyocera_FS-1010() { wget http://dl.dropbox.com/u/4170695/www/Kyocera-FS-1010.ppd -P /tmp lpadmin -p Kyocera-FS-1010 -v socket://192.168.1.11:9100 -E -P /tmp/Kyocera-FS-1010.ppd } function install_Kyocera_FS-1010_pako() { wget http://dl.dropbox.com/u/4170695/www/Kyocera-FS-1010.ppd -P /tmp lpadmin -p Kyocera_FS-1010_pako -v socket://192.168.2.1:9100 -E -P /tmp/Kyocera-FS-1010.ppd } function install_java-jdk() { script3 install.java-jdk.sh } function install_java-jre() { script3 install.java-jre.sh } function install_yajhfc() { script3 install.yajhfc.sh } function install_language() { install openoffice.org-help-de openoffice.org-l10n-de gimp-help-de gnome-user-guide-de openoffice.org-hyphenation openoffice.org-hyphenation-de openoffice.org-thesaurus-de openoffice.org-thesaurus-de-ch gimp-help-en gnome-user-guide-en openoffice.org-help-en-gb openoffice.org-l10n-en-gb openoffice.org-l10n-en-za openoffice.org-hyphenation-en-us openoffice.org-thesaurus-en-au openoffice.org-thesaurus-en-us } # install desktop function install_gnome_desktop() { # install gnome desktop install ubuntu-desktop # install gnome 3 classic RELEASE=$(lsb_release -rs | tr -d ".") if [ ${RELEASE} -ge 1110 ]; then install_gnome_fallback # remove unnecessary software sudo apt-get remove -y gnome-orca onboard fi # configure nautilus gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults/ -t string -s /apps/nautilus/preferences/default_folder_viewer 'list_view' gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults/ -t string -s /apps/nautilus/list_view/default_zoom_level smallest gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults/ -t string -s /apps/nautilus/preferences/show_directory_item_counts never # fix network manager, else VPN wont work sed -i 's|managed=false|managed=true|g' /etc/NetworkManager/nm-system-settings.conf sed -i 's|managed=false|managed=true|g' /etc/NetworkManager/NetworkManager.conf # natty # fix wait 60 sec for network sudo sed -i "s|sleep|#sleep|g" /etc/init/failsafe.conf # disable screen saver lock gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults/ -t boolean -s /apps/gnome-power-manager/lock_on_blank_screen false gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults/ -t boolean -s /apps/gnome-power-manager/lock_use_screensaver_settings false gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults/ -t boolean -s /apps/gnome-screensaver/idle_activation_enabled false # install extras install_desktop_extras # remove indicator-me applet # sudo apt-get remove -y indicator-me # fix clock in natty # todo (set for all user) gsettings set com.canonical.indicator.datetime show-day true gsettings set com.canonical.indicator.datetime show-date true # oneiric tweaks sudo apt-get install -y compizconfig-settings-manager } function install_lxdm_desktop() { # install lubuntu desktop install lubuntu-desktop # install pulse audio install pavucontrol pulseaudio pulseaudio-utils # install extras install_desktop_extras } # install default applications function install_desktop_extras() { install_ubuntu-restricted-extras install_thunderbird install_firefox install_java-jre install_libreoffice install_teamviewer apt-get install -y p7zip install linux-firmware-nonfree #broken? #install_language # fix slow print dialog (maverick) ### sed -i 's|Listen /var/run/cups/cups.sock|#Listen /var/run/cups/cups.sock|g' /etc/cups/cupsd.conf } # install gnome 3 fallback (classic) function install_gnome_fallback() { script3 install.gnome-fallback.sh } # install thunderbird function install_thunderbird() { script3 install.thunderbird.sh } # install firefox function install_firefox() { script3 install.firefox.sh } # install libreoffice function install_libreoffice() { script3 install.libreoffice.sh } # install multimedia function install_multimedia() { install_skype install_dvd install gbrainy install vlc mozilla-plugin-vlc # set vnc as default media player sed -i 's|totem.desktop|vlc.desktop|g' /etc/gnome/defaults.list } # install dvd support function install_dvd() { script3 install.dvd.sh } function install_nero() { script3 install.nero.sh http://fs/ubuntu/install/nerolinux-x86_64.deb } # install develop function install_develop() { install_netbeans # install_eclipse apt-get install -y openssh-server apt-get install -y scite apt-get install -y mysql-admin } # install mr function install_mr() { install openvpn network-manager-openvpn tofrodos imagemagick sshfs openoffice.org-java-common openoffice.org-base openoffice.org-officebean patch #err? install_yajhfc install_Laser #err? install_EpsonColor # install and configure ssh mounts script install.mrshare.sh # configure database source wget http://www.panticz.de/sites/default/files/DataAccess.xcu_.diff -P /tmp/ patch -p2 /usr/lib/openoffice/share/registry/data/org/openoffice/Office/DataAccess.xcu < /tmp/DataAccess.xcu_.diff # install nfs sudo apt-get install -y nfs-common # create mountpoints echo "srv:/programme /media/programme nfs4 _netdev,auto 0 0" >> /etc/fstab echo "srv:/bilder /media/bilder nfs4 _netdev,auto 0 0" >> /etc/fstab echo "srv:/lagerliste /media/lagerliste nfs4 _netdev,auto 0 0" >> /etc/fstab echo "srv:/projekte /media/projekte nfs4 _netdev,auto 0 0" >> /etc/fstab echo "srv:/texte /media/texte nfs4 _netdev,auto 0 0" >> /etc/fstab echo "srv:/develop /media/develop nfs4 _netdev,auto 0 0" >> /etc/fstab # load nfs module on startup cat /etc/modules | grep nfs || echo nfs >> /etc/modules } # ubuntu tuneup function ubuntu_tuneup() { # disable vnc-server (broken?) #gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults/ -t boolean -s /desktop/gnome/remote_access/enabled false # remove apps from autostart mkdir /etc/xdg/autostart/disabled mv /etc/xdg/autostart/bluetooth-applet.desktop /etc/xdg/autostart/disabled/ mv /etc/xdg/autostart/evolution-alarm-notify.desktop /etc/xdg/autostart/disabled/ mv /etc/xdg/autostart/gnome-at-session.desktop /etc/xdg/autostart/disabled/ mv /etc/xdg/autostart/gnome-user-share.desktop /etc/xdg/autostart/disabled/ mv /etc/xdg/autostart/jockey-gtk.desktop /etc/xdg/autostart/disabled/ mv /etc/xdg/autostart/libcanberra-login-sound.desktop /etc/xdg/autostart/disabled/ mv /etc/xdg/autostart/ubuntuone-launch.desktop /etc/xdg/autostart/disabled/ mv /etc/xdg/autostart/user-dirs-update-gtk.desktop /etc/xdg/autostart/disabled/ mv /etc/xdg/autostart/vino-server.desktop /etc/xdg/autostart/disabled/ mv /etc/xdg/autostart/gwibber.desktop /etc/xdg/autostart/disabled/ # mv /etc/xdg/autostart/zeitgeist-datahub.desktop /etc/xdg/autostart/disabled/ # disable services update-rc.d -f avahi-daemon remove update-rc.d -f bluetooth remove } # ubuntu_tuneup_extreme function ubuntu_tuneup_extreme() { ubuntu_tuneup #mv /etc/xdg/autostart/gnome-power-manager.desktop /etc/xdg/autostart/disabled/ #mv /etc/xdg/autostart/nm-applet.desktop /etc/xdg/autostart/disabled/ mv /etc/xdg/autostart/redhat-print-applet.desktop /etc/xdg/autostart/disabled/ mv /etc/xdg/autostart/update-notifier.desktop /etc/xdg/autostart/disabled/ # disable compiz effects (broken) # gconftool-2 --type string --set /apps/gnome-session/rh/window_manager "metacity" update-rc.d -f laptop-mode remove update-rc.d -f rsync remove #update-rc.d -f powernowd remove } # install_teamviewer function install_teamviewer() { script3 install.teamviewer.sh } # autostart function autostart_radio() { script3 gnome/enable.autostart.radio.sh $1 $2 } # gnome function gnome_autologin() { script3 gnome/enable.autologin.sh $1 } function gnome_human_list() { script gnome.humanlist.txt } function gnome_tuneup() { script gnome.reduced_resources.txt } # install function installForms() { install_wine script install.forms.sh $1 } function installUmtsmon() { script install.umtsmon.sh } function install_tipp10() { script3 install.tipp10.txt } function install_gimp() { script3 install.gimp.sh } function install_handbrake() { script3 install.handbrake.sh } function install_chromium() { script3 install.chromium.sh } function install_virtualbox() { script3 install.virtualbox.sh } function install_bcm() { script install.bcm.sh } function install_kvm() { apt-get install -y kvm qemu } function configure_pakonb() { # preconfigure fstab if [ "${MAC_HASH}" == "ca9ee1b29e06b343d73346b82a717e3d" ]; then echo "/dev/mapper/vg0-data /home ext4 defaults 0 2" >> /etc/fstab fi echo "hs:/hs /media/hs nfs4 _netdev,auto 0 0" >> /etc/fstab echo "hs:/video /media/video nfs4 _netdev,auto 0 0" >> /etc/fstab # configure hosts (fixme) #cat <> /etc/hosts #192.168.2.1 hs #192.168.2.3 xbmc #EOF # add user to group usermod -a -G fuse pako usermod -a -G lpadmin pako #?# usermod -a -G admin pako # install aplications ###apt-get install -y vncviewer xvnc4viewer apt-get install -y mbr mtools install_chromium ### install_gimp apt-get install -y telepathy-sofiasip apt-get install -y filezilla ###apt-get install -y couturier apt-get install -y fprint-demo #libfprint0 libpam-fprint apt-get install -y libnotify-bin apt-get install -y pdftk apt-get install -y syslinux apt-get install -y gnomebaker apt-get install -y searchmonkey apt-get install -y compizconfig-settings-manager apt-get install -y pdfshuffler apt-get install -y libmysql-java apt-get install -y nfs-common install_handbrake # install old firefox 3.6 install_Kyocera_FS-1010_pako # todo truecrypt (todo) # http://hacktolive.org/wiki/Repository # dep # script install.sflphone.sh # BROKEN # .config perimssions are set to root # script install.app-runner.sh # set android usb rights cat < /etc/udev/rules.d/70-android.rules SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666" EOF # remove applications #apt-get remove -y ubuntuone-client ubuntuone-client-gnome # configure sudoers echo "pako ALL=NOPASSWD: /home/pako/privat/scripts/build/mkXbmc.sh" >> /etc/sudoers # disable gedit backup files su pako -c 'gconftool-2 --type bool --set /apps/gedit-2/preferences/editor/save/create_backup_copy "false"' # set default printer lpoptions -d Laser # install mssql driver wget http://netcologne.dl.sourceforge.net/project/jtds/jtds/1.2.5/jtds-1.2.5-dist.zip -P /tmp/ unzip /tmp/jtds-1.2.5-dist.zip -d /tmp/ sudo cp /tmp/jtds-1.2.5.jar /usr/share/java/ } function configure_locale() { # configure locale echo 'LANG="de_DE.UTF-8"' > /etc/default/locale echo 'LANG="de_DE.UTF-8"' >> /etc/environment echo 'de_DE.UTF-8 UTF-8' > /etc/locale.gen } function install_nvidia_graphic() { script3 install.nvidia-graphic.sh } function addToFuse() { USER=$1 sudo usermod -a -G fuse ${USER} } function enableAutoUpdate() { sed -i '4s|//| |g' /etc/apt/apt.conf.d/50unattended-upgrades sed -i 's|//Unattended-Upgrade::Mail|Unattended-Upgrade::Mail|g' /etc/apt/apt.conf.d/50unattended-upgrades sed -i 's|APT::Periodic::Download-Upgradeable-Packages "0";|APT::Periodic::Download-Upgradeable-Packages "1";|g' /etc/apt/apt.conf.d/10periodic sed -i 's|APT::Periodic::AutocleanInterval "0";|APT::Periodic::AutocleanInterval "1";|g' /etc/apt/apt.conf.d/10periodic echo 'APT::Periodic::Unattended-Upgrade "1";' >> /etc/apt/apt.conf.d/10periodic } function install_ipmi() { script2 install.ipmi.sh } function install_cpuburn() { script2 install.cpuburn.sh } function install_cpuload() { script2 install.cpuload.sh } function install_powermeter() { install_gnome_desktop install openssh-server install stress install libcurl3 install wget #powernowd #cpufrequtils #cpufreqd #sysfsutils install_ipmi install_cpuburn install_cpuload #gnome_autologin sts } #function install_docky() { # add-apt-repository ppa:docky-core/ppa # apt-get update -qq # apt-get install -y docky # apt-get install -y xdotool #} # Disable console blanking setterm -blank 0 # Save start time echo "--- START ${MAC} $(date) ---" >> ${LOG} # Update the package list apt-get update -qq | tee -a ${LOG} apt-get dist-upgrade -y -qq | tee -a ${LOG} # Install basics needed for further installation or debugging case "${MAC_HASH}" in 684fe92547d7b3a29608a222caca83c4) # dell install_lxdm_desktop install_multimedia ubuntu_tuneup ;; 239f267ee5a72d72a15af714385104dc) # ewixpc install_gnome_desktop install_multimedia ubuntu_tuneup install_tipp10 install_dropbox ;; 129aa5001cd1bb256c1dfff0c7fd14db) # evixpc install_gnome_desktop install_multimedia install_tipp10 install_dropbox install nvidia-glx-173 ;; fcb0e0c856ad654205232ecacf32bdcc) # evixnb install_gnome_desktop install_multimedia install_tipp10 install_dropbox ubuntu_tuneup # fix upsidedown webcam wget http://www.panticz.de/sites/default/files/scripts/skype.fix.webcam.sh -O - | bash - autostart_radio ewa "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2120856" # RMF FM gnome_autologin ewa sudo apt-get remove -y transmission-gtk transmission-common #install_acroread #install k9copy ;; ca9ee1b29e06b343d73346b82a717e3d) # pakonb install_gnome_desktop install_multimedia installForms pako ### ubuntu_tuneup install_develop install_sqldeveloper pako install_mr #gnome_human_list install_java-jdk install_dropbox ### install_acroread install_virtualbox ### install_docky enableAutoUpdate configure_pakonb install_nvidia_graphic #install_kvm install_nero ### install_Kyocera_FS-1010 ;; 61271b58b4b5e8de739cde1b89330a9a) # itdev_nic1 # install openssh-server install_gnome_desktop install_multimedia installForms pako ### ubuntu_tuneup install_develop install_sqldeveloper pako install_mr #gnome_human_list install_java-jdk install_dropbox ### install_acroread install_virtualbox ### install_docky enableAutoUpdate configure_pakonb install_nvidia_graphic #install_kvm install_nero ### install_Kyocera_FS-1010 ;; 1900c624502767436e12e7f0d325912f) # itdev_nic2 # install openssh-server install_gnome_desktop install_multimedia installForms pako ### ubuntu_tuneup install_develop install_sqldeveloper pako install_mr #gnome_human_list install_java-jdk install_dropbox ### install_acroread install_virtualbox ### install_docky enableAutoUpdate configure_pakonb install_nvidia_graphic #install_kvm install_nero ### install_Kyocera_FS-1010 ;; f48a15d0a76154590610f131b7414c9c) # sininb install_gnome_desktop install_multimedia installForms sini ubuntu_tuneup install_mr install_nvidia_graphic script hardware.sininb.txt ;; 08b6deba423b0f78877184d19244dc37) # jurinb install_gnome_desktop install_multimedia installForms juri ubuntu_tuneup install_mr #script3 http://installit.googlecode.com/hg/hardware/wlan.medion-md-95400.sh script2 install.brother-mfc-7320.printer.sh script2 install.brother-mfc-7320.scanner.sh ;; 55a27743800b638e07c46476b5f64b47) # mutix install_gnome_desktop install_multimedia ubuntu_tuneup install_bcm echo "options i915 modeset=1" >> /etc/modprobe.d/i915-kms.conf ##su anna -c "metacity --replace &" ;; 3ee79c4e43c6c640c29c0390b08a9fc1) # klflnb install_gnome_desktop install_multimedia install_dropbox installForms klfl install_mr ;; d8d36bf1f5a26e35290f9f96989903d5) # dibrpc install_gnome_desktop install_multimedia ubuntu_tuneup install gbrainy install_wine install audacity ;; 77c0db6bc46ae42d5a063168737e91b1) # moninb install_gnome_desktop install_multimedia # ubuntu_tuneup install_dropbox install_tipp10 # echo "/dev/sda3 ext3 defaults 0 2" >> /etc/fstab ;; 22611843b35468d6d766ce7431b388f3) # moninb_old install_gnome_desktop install_multimedia ubuntu_tuneup install_dropbox install_tipp10 echo "/dev/sda3 ext3 defaults 0 2" >> /etc/fstab ;; 18a6182f51938978388b9aa1e0fdfb04) # eeepc install_gnome_desktop install_multimedia installForms eeepc ubuntu_tuneup install_mr addToFuse ${USER} gnome_autologin eeepc install usb-modeswitch #installUmtsmon ;; 994ded59ad206ddf33f1c91a29d845b4) # svietapc install_gnome_desktop install_multimedia ubuntu_tuneup install network-manager-vpnc ;; a2658dd1e110a753e9a0596025668a44) # janny install ubuntu-netbook install_desktop_extras install_multimedia install_dropbox gconftool-2 --set /apps/metacity/general/button_layout --type string menu:minimize,maximize,close ;; d3c8873db5f05e3fea51df13d7c5b93d) # pm1 install_powermeter ;; 5528466a5bbafae2fbb82bac810b1204) # ts msi install ubuntu-desktop install ssh install_dropbox install_teamviewer ;; esac # configure locale configure_locale # Set the debconf priority back to low #echo debconf debconf/priority select low | debconf-set-selections -v 2>&1 | tee -a ${LOG} # Save the end time echo "--- START ${MAC} $(date) ---" >> ${LOG} # Remove init script rm /etc/rc2.d/S99install rm /etc/init/late_command.conf # Update the package list apt-get update -qq | tee -a ${LOG} apt-get dist-upgrade -y -qq | tee -a ${LOG} # clean up apt-get clean | tee -a ${LOG} apt-get -y autoremove | tee -a ${LOG} # Sync and reboot sync sleep 3 reboot