#!/bin/bash
#######################################################################
#
# Dieses Script soll die ersten Schritte mit Ubuntu 10.10 Maverick Meerkat 32-Bit und 64-Bit erleichtern,
# so dass man sein System an seine Wuensche anpassen und ggf. optimieren kann.
#
# The script comes with no warranty. The author is not responsible if
# your system breaks.
#
#
# 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 .
#
# Title : ubuntu-10.10-tweak
# Author : Lars Moelleken (suckup.de)
# Date : 2010-10-13
# Requires : dialog, mktemp (sudo aptitude install dialog mktemp)
#
# based on the script of: Copyright (C) 2010 Alin Andrei, http://www.webupd8.org - ubuntu-10.10-script
#
#######################################################################
# einige Variablen werden festgelegt
VERSION="0.2"
LINUXPKG="linux-(image|headers|ubuntu-modules|restricted-modules)"
METALINUXPKG="linux-(image|headers|restricted-modules)-(generic|i386|server|common|rt|xen)"
TRUETYPEPATH="/usr/share/fonts/truetype/"
SOURCES="/etc/apt/sources.list"
SOURCESD="/etc/apt/sources.list.d"
BACKUP="/etc/apt/backup"
BACKUP_OLD="/etc/apt/backup_old"
export OLDCONF=$(dpkg -l|grep "^rc"|awk '{print $2}')
export CURKERNEL=$(uname -r|sed 's/-*[a-z]//g'|sed 's/-386//g')
export OLDKERNELS=$(dpkg -l|awk '{print $2}'|grep -E ${LINUXPKG} |grep -vE ${METALINUXPKG}|grep -v ${CURKERNEL})
export USER=$(whoami)
export TMPFILE=$(mktemp -t)
export ARCHITECTURE=$(uname -m)
export HOST=$(hostname)
export UBUNTU=$(lsb_release -cs)
export PATH="/usr/bin:/usr/sbin:/bin:/sbin"
# check: ist "aptitude / dialog / mktemp" installiert?
if [ \! -f `whereis aptitude | cut -f 2 -d ' '` ] ; then
# wenn nicht, wird dies installiert
sudo apt-get install aptitude
fi
if [ \! -f `whereis dialog | cut -f 2 -d ' '` ] ; then
# wenn nicht, wird dies installiert
sudo aptitude install dialog
fi
if [ \! -f `whereis mktemp | cut -f 2 -d ' '` ] ; then
# wenn nicht, wird dies installiert
sudo aptitude install mktemp
fi
# chooseDialog: Einstellungen fuer "dialog" werden mit dieser Funktion festgelegt
#
function chooseDialog {
DIALOGAPP=`which dialog 2> /dev/null` || DIALOGAPP=`which whiptail 2> /dev/null`
}
# setDialogDimensions: Funktion um die Groesse von "dialog" zu bestimmen
#
# Das Skript sieht nur hier am Anfang etwas eigenartig aus, im weiterem Verlauf, lassen sich...
# ... verstaendlichere Beispiele fuer Funktionen etc. finden. ;-)
#
function setDialogDimensions {
test -x /usr/bin/tty && CONSOLE=`/usr/bin/tty`
test -z "${CONSOLE}" && CONSOLE=/dev/console
# Konsolen groesse bestimmen (Zeilen - Spalten)
SIZE=$(stty size < ${CONSOLE})
SCREEN_W=${SIZE#*\ }
SCREEN_H=${SIZE%%\ *}
if [ "${SCREEN_W}" -gt 0 ]; then
let "MAX_W = ${SCREEN_W} - 2"
fi
if [ "${SCREEN_H}" -gt 0 ]; then
let "MAX_H = ${SCREEN_H} - 2"
fi
TEXT_W=`echo "${1}" | wc -L`
TEXT_H=`echo "${1}" | wc -l`
let "DIALOG_H = $TEXT_H + 8"
let "THRESH = 2 * ${DIALOG_H}"
let "DIALOG_W = ${TEXT_W} + 8"
if [ ${DIALOG_W} -lt ${THRESH} ]; then
let "DIALOG_W = 2 * ${DIALOG_W}"
fi
if [ "${DIALOG_W}" -lt 20 ]; then
let "DIALOG_W = 20"
fi
if [ "${DIALOG_H}" -lt 10 ]; then
let "DIALOG_H = 10"
fi
if [ "${DIALOG_W}" -gt "${MAX_W}" ]; then
let "DIALOG_W = ${MAX_W}"
fi
if [ "${DIALOG_H}" -gt "${MAX_H}" ]; then
let "DIALOG_H = ${MAX_H}"
fi
}
# check: ob Ubuntu maverick installiert ist
if [ "maverick" = ${UBUNTU} ]; then
# check: ob Ubuntu in 32 oder 64-Bit installiert ist
chooseDialog
TITLE="Ubuntu 10.10"
MESSAGE="\nUbuntu 10.10 Maverick Meerkat - OK"
setDialogDimensions "${MESSAGE}"
dialog --title " `echo -e "${TITLE}"`" --infobox "`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
if [ "i686" = ${ARCHITECTURE} ]; then
ARCH=i386
elif [ "x86_64" = ${ARCHITECTURE} ]; then
ARCH=amd64
# ansonsten wird das Skript beenedet (!= 32 bzw. 64-Bit System)
else
chooseDialog
TITLE="ERROR: Du nutzt nicht Ubuntu 10.10"
MESSAGE="\nDu nutzt nicht Ubuntu 10.10 Maverick Meerkat 32 oder 64-Bit"
setDialogDimensions "${MESSAGE}"
dialog --title "`echo -e "${TITLE}"`" --msgbox "`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
fi
# ansonsten wird das Skript beendet (!= maverick)
else
chooseDialog
TITLE="ERROR: Du nutzt nicht Ubuntu 10.10"
MESSAGE="\nDu nutzt nicht Ubuntu 10.10 Maverick Meerkat 32 oder 64-Bit"
setDialogDimensions "${MESSAGE}"
dialog --title "`echo -e "${TITLE}"`" --infobox "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
# wenn gewuenscht, wird das Update auf Version 10.10 installiert
chooseDialog
# FEHLER - Auswahl LTS oder NORMAL
TITLE="Ubuntu 10.10 Maverick Meerkat"
MESSAGE="Ubuntu Update 10.10 Maverick Meerkat auf $HOST installieren? "
setDialogDimensions "${MESSAGE}"
dialog --title "`echo -e "${TITLE}"`" --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "0" ]; then
apt-get update && aptitude upgrade
aptitude install update-manager-core
sudo sed -i "s/Prompt.*/Prompt=normal/g" /etc/update-manager/release-upgrades
do-release-upgrade
exit
else
exit
fi
fi
# check: ob du die passenden Rechte hast (!= root)
if [ ${USER} != "root" ]; then
chooseDialog
TITLE="ERROR: Du bist nicht root"
MESSAGE="\nDu bist nicht root, du bist '${USER}'!\n\n (versuche es mal mit \"sudo bash $0\")"
setDialogDimensions "${MESSAGE}"
dialog --colors --title "`echo -e "${TITLE}"`" --msgbox "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
exit
fi
# check: ob Updates anstehen
COUNT=`apt-get -s upgrade | grep -c "Inst"`
chooseDialog
TITLE="[${HOST}] - Update Hinweis"
MESSAGE="SYSTEMMELDUNG:\nAuf ${HOST} sind ${COUNT} neue Updates vorhanden!"
setDialogDimensions "${MESSAGE}"
# wenn Updates ansteht, wird eine Meldung uber dessen Anzahl angezeigt
if [ ${COUNT} -gt 0 ]; then
dialog --title " ${TITLE} " --msgbox "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
fi
# Ein Backup der aktuellen sources.list wird erstellt...
# ... wenn das Verzeichnis bereits angelegt ist.
if [ -d ${BACKUP} ] ; then
# fuer alle Dateien, im Backup-Verzeichnis
for I in `ls ${BACKUP}` ; do
# wenn diese nicht bereits auf .bz2 enden
if [ ${I} != "*.bz2" ]; then
# werden die Dateien komprimiert...
# ... mit "bunzip2" kann man diese wieder dekomprimieren.
bzip2 -z -f -q ${BACKUP}/${I}
fi
done
else
# ansonsten wird erst-einmal das Backup-Verzeichnis angelegt
mkdir ${BACKUP}
chooseDialog
TITLE="Backup-Verzeichnis"
MESSAGE="Backup-Verzeichnis wurde angelegt - ${BACKUP}"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --msgbox "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
fi
# wenn bereits Dateien in dem Verzeichnis liegen, dann...
if [ -d ${BACKUP} ] ; then
# nach 30 Tagen werden die Backups gelöscht
find ${BACKUP} -iregex '.*\.\(bz2\)' -mtime +7 -exec mv {} ${BACKUP_OLD} \;
# nach 7 Tagen werden die Dateien nach /etc/apt/backup_old verschoben
find ${BACKUP_OLD} -iregex '.*\.\(bz2\)' -mtime +30 -exec rm {} \;
else
# ansonsten wird erst-einmal das Backup_old-Verzeichnis angelegt
mkdir ${BACKUP_OLD}
chooseDialog
TITLE="Backup-Verzeichnis"
MESSAGE="Backup_old-Verzeichnis wurde angelegt - ${BACKUP_OLD}"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --msgbox "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
fi
# und die sources.list mit dem aktuellen Datum gespeichert
BAK=sources.old.$(date "+%y%m%d-%H%M")
cp -p ${SOURCES} ${BACKUP}/${BAK}
chooseDialog
TITLE="Backup-sources.list"
MESSAGE="Backup deiner sources.list wurde angelegt - ${BACKUP}/${BAK}"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --msgbox "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
# TEST: Programm-Teil, um die Eintraege vom "sources.list.d"-Verzeichnis in die sources.list zu migrieren
# dazu muss die naechste Zeile auskommentiert werden und die darauffolgende einkommentiert werden...
#
# ... habe die Funktion mit folgende Falschen-If-Abfrage erst-einmal aus-geschaltet...
# ... !!! dieser Teil wird daher momentan NICHT ausgeführt !!!
if [ 1 = 2 ] ; then
# FEHLER: Hier muss noch irgendwie geprueft werden, ob Dateien, welche mit "*.list", im Verzeichnis vorhaben sind...
# ... hatte es mit folgendem Befehl versucht -> if [ `ls /etc/apt/sources.list.d/*.list | wc -w` > 0 ]; then
#if [ -d ${SOURCESD} ] ; then
chooseDialog
TITLE="${SOURCESD} migrieren?"
MESSAGE="Moechtest du die Repositories welche in einem Unterverzeichnis liegen, in deine sources.list migrieren?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "1" ]; then
chooseDialog
TITLE="Keine Migration"
MESSAGE="Die sources.list.d Einträge wurden nicht mit der sources.list zusammengefasst."
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --msgbox "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
else
# Kommentare und Leerzeilen werden entfernt
for I in `ls ${SOURCESD}/*.list`; do
sed -e "s/#.*//g" -e "s/ *$//" -e "/^$/d" ${I} | sort -u > ${TMPFILE};
done
for I in `ls ${SOURCES}`; do
sed -e "s/#.*//g" -e "s/ *$//" -e "/^$/d" ${I} | sort -u >> ${TMPFILE};
done
N=1
# Ergebnis wird in ein Array geschrieben
while read RESULT; do
ARRAY[${N}]=${RESULT}
N=`expr ${N} + 1`
done < ${TMPFILE}
rm ${TMPFILE}
# Array wird Zeilenweise wieder in eine Datei geschrieben
for I in `seq 0 ${#ARRAY[@]}`; do
echo "${ARRAY[${I}]}" >> ${TMPFILE}
done
chooseDialog
TITLE="Repositories migrieren"
MESSAGE="Moechtest du die Dateien wirklich migrieren?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "0" ]; then
# Ergebnis wird nun in die sources.list geschrieben und es wird aufgeraeumt
sed -e "s/#.*//g" -e "s/ *$//" -e "/^$/d" ${TMPFILE} | sort -u > ${SOURCES}
rm ${SOURCESD}/*.list
else
chooseDialog
TITLE="Keine Migration"
MESSAGE="Die sources.list.d Einträge wurden nicht mit der sources.list zusammengefasst."
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --msgbox "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
fi
fi
fi
# check: ob ein Paket-Manager bereits laeuft
sleep 1
for LOCK in synaptic update-manager software-center apt-get dpkg aptitude ; do
# wenn ein Update-Manager bereits laeft, dann wird das Skript beendet
if ps -U root -u root u | grep ${LOCK} | grep -v grep > /dev/null; then
chooseDialog
TITLE="ERROR: ${LOCK} laeuft bereits"
MESSAGE="SYSTEMMELDUNG:\nDas Skript wird nicht laufen, wenn du ${LOCK} nicht vorher beendest!"
setDialogDimensions "${MESSAGE}"
dialog --title " ERROR: ${LOCK} laeuft bereits " --msgbox "\n`echo -e "${MESSAGE}"`" 10 50
exit
fi
done
# gconf-tool mit den passenden User-Rechten starten
ON_USER=$(echo ~ | awk -F'/' '{ print $1 $2 $3 }' | sed 's/home//g')
export $(grep -v "^#" ~/.dbus/session-bus/`cat /var/lib/dbus/machine-id`-0)
if sudo -u ${ON_USER} test -z "${DBUS_SESSION_BUS_ADDRESS}" ; then
eval `sudo -u ${ON_USER} dbus-launch --sh-syntax --exit-with-session`
fi
# testConnection: check-funktion - ob eine Internet-Verbindung besteht
#
function testConnection() {
# Verbindung nach www.google.de wird 3-mal versucht aufzubauen
TESTCONNECTION=`wget --tries=3 --timeout=10 www.google.de -O ${TMPFILE} &>/dev/null 2>&1`
# wenn keine Verbindung hergestellt werden konnte, dann wird eine entsprechende Meldung angezeigt
if [ ${?} != 0 ]; then
chooseDialog
TITLE="INFO: Internet-Verbindung - Problem"
MESSAGE="\nEs besteht ggf. momentan keine Internet-Verbindung (www.google.de konnte nicht erreicht werden), es koennen einige Funktionen des Skriptes daher nicht genutzt werden."
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --msgbox "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
export INTERNET="nein"
else
# ansonsten ist alles OK
chooseDialog
TITLE="INFO: Internet-Verbindung - OK"
MESSAGE="\nEs besteht eine Internet-Verbindung."
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --infobox "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
export INTERNET="ja"
fi
}
# launchpad_add: In dieser Funktion, kann man mehrere Dinge auswaehlen, die ausgewaehlen Punkte, werden in ein Array
# ... geschrieben und einen nach dem anderen Punkt abgearbeitet.
#
function launchpad_add() {
# check-funktion wird aufgerufen
testConnection
# launchpad: diese Funktion zum einfuegen der Repository...
# ... wurde auskommentiert, da diese nicht mehr benoetigt wird...
# ... lasse diese jedoch noch hier stehen, ggf. kann es jemandem als Beispiel, weiterhelfen.
#
#function launchpad() {
#grep -iv $1 ${SOURCES} > ${TMPFILE}
#cp -p ${TMPFILE} ${SOURCES}
#A="## ${2} (${1})"
#B="deb http://ppa.launchpad.net/$1/ubuntu $UBUNTU main"
#C="deb-src http://ppa.launchpad.net/$1/ubuntu $UBUNTU main"
#echo -e "${A}" "\n${B}" "\n${C}" >> ${SOURCES}
#}
chooseDialog
TITLE="Extra-Repositories"
MESSAGE="Extra-Repositories: fuer Ubuntu 10.10"
setDialogDimensions "${MESSAGE}"
dialog --backtitle " ${TITLE} " \
--checklist "\n`echo -e "${MESSAGE}"`" 120 80 60 \
01 "Medibuntu" off\
02 "Ailurus - Ubuntu Tweak Tool + Erklaerung" off\
03 "Avant - Window Navigator" off\
04 "Nautilus Elementary - erweiterter Dateimanager" off\
05 "Gloobus - Datei (Bild, Text, Audio...) Vorschau" off\
06 "Compiz - 3D Desktop" off\
07 "Chromium - Google Chrome fuer Ubuntu" off\
08 "GlobalMenu - Globals Menue fuer das Gnome-Panel" off\
09 "OpenOffice - Office (Tabellen- Textverarbeitung...)" off\
10 "Gnome DO - Globaler Programm-Starter" off\
11 "Ubuntu Tweak - Ubuntu Tweak Tool" off\
12 "Wine - Windows Programme in Linux starten" off\
13 "X-Server - Desktop Updates" off\
14 "Flash - non-free Adobe Flash" off\
15 "Bisigi - Ubuntu Themes" off\
16 "GetDep - viele neue Programm Updates" off\
17 "VirtualBox - Virtuelle PCs installieren" off\
18 "Swiftfox - optimierte Firefox-Version" off\
19 "Dropbox - Netzwerk-Dateisystem" off\
20 "Pidgin - Chat-Client" off\
21 "gpm - Mauszeigers in der Systemkonsole" off\
22 "Claws Mail - schneller Mail-Client" off\
23 "VLC - Media Player" off\
24 "Skype - VoIP-Software" off 2>${TMPFILE}
if [ ${?} -ne 0 ]; then return; fi
read RESULT <${TMPFILE}
ARRAY=(${RESULT})
chooseDialog
TITLE="Extra-Repositories"
MESSAGE="Moechtest du die Extra-Repositories wirklich eintragen?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "1" ]; then return; fi
for I in ${ARRAY[@]}; do
case ${I} in
\"01\")
grep -iv medibuntu ${SOURCES} > ${TMPFILE}
cp -p ${TMPFILE} ${SOURCES}
sudo wget --output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list
cd && wget http://packages.medibuntu.org/pool/free/m/medibuntu-keyring/medibuntu-keyring_2008.04.20_all.deb && sudo dpkg -i medibuntu-keyring_2008.04.20_all.deb && rm medibuntu-keyring_2008.04.20_all.deb
sudo apt-get update && sudo aptitude install app-install-data-medibuntu
chooseDialog
sudo apt-get update && sudo aptitude install app-install-data-medibuntu apport-hooks-medibuntu
TITLE="Codecs installieren"
MESSAGE="Moechtest du das codecs-Pakete (+DVD Unterstuetzung) von medibuntu installieren?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "0" ]; then
sudo apt-get update && sudo aptitude install libdvdcss2 ubuntu-restricted-extras
if [ ${ARCH} = "i386" ]; then
sudo aptitude install w32codecs mplayer mozilla-mplayer
elif [ ${ARCH} = "amd64" ]; then
sudo aptitude install w64codecs mplayer mozilla-mplayer
fi
fi
;;
\"02\")
grep -iv ailurus ${SOURCES} > ${TMPFILE}
cp -p ${TMPFILE} ${SOURCES}
sudo add-apt-repository ppa:ailurus/ppa
chooseDialog
TITLE="Ailurus installieren"
MESSAGE="Moechtest du auch das Paket (Ailurus) installieren?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "0" ]; then
sudo apt-get update && sudo aptitude install ailurus
fi
;;
\"03\")
grep -iv awn-testing ${SOURCES} > ${TMPFILE}
cp -p ${TMPFILE} ${SOURCES}
sudo add-apt-repository ppa:awn-testing/ppa
chooseDialog
TITLE="AWN installieren"
MESSAGE="Moechtest du auch das Paket (AWN) installieren?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "0" ]; then
sudo apt-get update && sudo aptitude install avant-window-navigator awn-applets-c-extras awn-applets-python-extras python-awn-extras
fi
;;
\"04\")
grep -iv nautilus-elementary ${SOURCES} > ${TMPFILE}
cp -p ${TMPFILE} ${SOURCES}
sudo add-apt-repository ppa:am-monkeyd/nautilus-elementary-ppa
grep -iv elementaryart ${SOURCES} > ${TMPFILE}
cp -p ${TMPFILE} ${SOURCES}
sudo add-apt-repository ppa:elementaryart/elementarydesktop
chooseDialog
TITLE="Nautilus-Elementary installieren"
MESSAGE="Moechtest du auch das Paket (Nautilus-Elementary) installieren?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "0" ]; then
sudo apt-get update && sudo aptitude upgrade nautilus && sudo aptitude install elementary-desktop
fi
;;
\"05\")
grep -iv gloobus ${SOURCES} > ${TMPFILE}
cp -p ${TMPFILE} ${SOURCES}
sudo add-apt-repository ppa:gloobus-dev/gloobus-preview
chooseDialog
TITLE="Gloobus-Preview installieren"
MESSAGE="Moechtest du auch das Paket (Gloobus-Preview) installieren?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "0" ]; then
sudo apt-get update && sudo aptitude install gloobus-preview
fi
;;
\"06\")
grep -iv compiz ${SOURCES} > ${TMPFILE}
cp -p ${TMPFILE} ${SOURCES}
sudo add-apt-repository ppa:compiz/ppa
chooseDialog
TITLE="Compiz updaten"
MESSAGE="Moechtest du auch das Paket (Compiz) installieren?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "0" ]; then
sudo apt-get update && sudo aptitude upgrade compiz
sudo aptitude install compizconfig-settings-manager
fi
;;
\"07\")
grep -iv chromium-daily ${SOURCES} > ${TMPFILE}
cp -p ${TMPFILE} ${SOURCES}
sudo add-apt-repository ppa:chromium-daily/ppa
chooseDialog
TITLE="Chromium installieren"
MESSAGE="Moechtest du auch das Paket (Chromium) installieren?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "0" ]; then
sudo apt-get update && sudo aptitude install chromium-browser chromium-browser-l10n chromium-codecs-ffmpeg-extra
fi
;;
\"08\")
grep -iv globalmenu ${SOURCES} > ${TMPFILE}
cp -p ${TMPFILE} ${SOURCES}
sudo add-apt-repository ppa:globalmenu-team/ppa
chooseDialog
TITLE="GlobalMenu installieren"
MESSAGE="Moechtest du auch das Paket (GlobalMenu) installieren?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "0" ]; then
sudo apt-get update && sudo aptitude install gnome-globalmenu
fi
;;
\"09\")
grep -iv openoffice ${SOURCES} > ${TMPFILE}
cp -p ${TMPFILE} ${SOURCES}
sudo add-apt-repository ppa:openoffice-pkgs
chooseDialog
TITLE="OpenOffice updaten"
MESSAGE="Moechtest du auch das Paket (OpenOffice) installieren?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "0" ]; then
sudo apt-get update && sudo aptitude install openoffice.org openoffice.org-l10n-de openoffice.org-help-de openoffice.org-l10n-common openoffice.org-gnome openoffice.org-kde openoffice.org-evolution
fi
;;
\"10\")
grep -iv do-core ${SOURCES} > ${TMPFILE}
cp -p ${TMPFILE} ${SOURCES}
sudo add-apt-repository ppa:do-core/ppa
chooseDialog
TITLE="Gnome-Do installieren"
MESSAGE="Moechtest du auch das Paket (Gnome-Do) installieren?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "0" ]; then
sudo apt-get update && sudo aptitude install gnome-do
fi
;;
\"11\")
grep -iv tualatrix ${SOURCES} > ${TMPFILE}
cp -p ${TMPFILE} ${SOURCES}
sudo add-apt-repository ppa:tualatrix/ppa
grep -iv ubuntu-tweak ${SOURCES} > ${TMPFILE}
cp -p ${TMPFILE} ${SOURCES}
sudo add-apt-repository ppa:ubuntu-tweak-testing/ppa
chooseDialog
TITLE="Ubuntu-Tweak installieren"
MESSAGE="Moechtest du auch das Paket (Ubuntu-Tweak) installieren?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "0" ]; then
sudo apt-get update && sudo aptitude install ubuntu-tweak
fi
;;
\"12\")
grep -iv ubuntu-wine ${SOURCES} > ${TMPFILE}
cp -p ${TMPFILE} ${SOURCES}
sudo add-apt-repository ppa:ubuntu-wine/ppa
chooseDialog
TITLE="Wine installieren"
MESSAGE="Moechtest du auch das Paket (Wine) installieren?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "0" ]; then
sudo apt-get update && sudo aptitude install wine1.2
fi
;;
\"13\")
grep -iv x-updates ${SOURCES} > ${TMPFILE}
cp -p ${TMPFILE} ${SOURCES}
sudo add-apt-repository ppa:ubuntu-x-swat/x-updates
chooseDialog
TITLE="X-Server update"
MESSAGE="Moechtest du auch das Paket (X-Server) updaten?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "0" ]; then
sudo apt-get update && sudo aptitude upgrade
fi
;;
\"14\")
grep -iv sevenmachines ${SOURCES} > ${TMPFILE}
cp -p ${TMPFILE} ${SOURCES}
sudo add-apt-repository ppa:sevenmachines/flash
chooseDialog
TITLE="flashplugin installieren"
MESSAGE="Moechtest du auch das Paket (flashplugin) installieren?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "0" ]; then
pkill -9 firefox*
if [ ${ARCH} = "i386" ]; then
sudo aptitude purge flashplugin-nonfree gnash gnash-common mozilla-plugin-gnash swfdec-mozilla libflashsupport nspluginwrapper flashplugin-installer
sudo rm -f /usr/lib/mozilla/plugins/*flash*
sudo rm -f ~/.mozilla/plugins/*flash*
sudo rm -f /usr/lib/firefox/plugins/*flash*
sudo rm -f /usr/lib/firefox-addons/plugins/*flash*
sudo rm -rfd /usr/lib/nspluginwrapper
sudo apt-get update && sudo aptitude install flashplugin-nonfree
elif [ ${ARCH} = "amd64" ]; then
sudo aptitude purge flashplugin-nonfree gnash gnash-common mozilla-plugin-gnash swfdec-mozilla libflashsupport nspluginwrapper flashplugin-installer
sudo rm -f /usr/lib/mozilla/plugins/*flash*
sudo rm -f ~/.mozilla/plugins/*flash*
sudo rm -f /usr/lib/firefox/plugins/*flash*
sudo rm -f /usr/lib/firefox-addons/plugins/*flash*
sudo rm -rfd /usr/lib/nspluginwrapper
sudo apt-get update && sudo aptitude install flashplugin64-nonfree
fi
fi
;;
\"15\")
grep -iv bisigi ${SOURCES} > ${TMPFILE}
cp -p ${TMPFILE} ${SOURCES}
sudo add-apt-repository ppa:bisigi/ppa
chooseDialog
TITLE="zusaetzliche Ubuntu Themes installieren"
MESSAGE="Moechtest du auch die Pakete installieren?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "0" ]; then
sudo apt-get update && sudo aptitude install bisigi-themes community-themes
fi
;;
\"16\")
grep -iv getdeb ${SOURCES} > ${TMPFILE}
cp -p ${TMPFILE} ${SOURCES}
A="## GetDeb"
B="deb http://archive.getdeb.net/ubuntu maverick-getdeb apps"
C="deb http://archive.getdeb.net/ubuntu maverick-getdeb games"
D="deb-src http://archive.getdeb.net/ubuntu maverick-getdeb apps"
E="deb-src http://archive.getdeb.net/ubuntu maverick-getdeb games"
echo -e "${A}" "\n${B}" "\n${C}" "\n${D}" "\n${E}" >> ${SOURCES}
wget -q -O- http://archive.getdeb.net/getdeb-archive.key | sudo apt-key add -
chooseDialog
TITLE="Update durchfuehren"
MESSAGE="Moechtest du das Update (Quellen von getdeb.net) nun durchfuehren?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "0" ]; then
sudo apt-get update && sudo aptitude -t maverick-getdeb upgrade
fi
;;
\"17\")
grep -iv download.virtualbox ${SOURCES} > ${TMPFILE}
cp -p ${TMPFILE} ${SOURCES}
A="## VirtualBox (download.virtualbox)"
B="deb http://download.virtualbox.org/virtualbox/debian maverick non-free"
echo -e "${A}" "\n${B}" >> ${SOURCES}
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -
chooseDialog
TITLE="VirtualBox installieren"
MESSAGE="Moechtest du auch das Paket (VirtualBox) installieren?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "0" ]; then
sudo apt-get update && sudo aptitude install virtualbox-3.2
fi
;;
\"18\")
grep -iv getswiftfox ${SOURCES} > ${TMPFILE}
cp -p ${TMPFILE} ${SOURCES}
A="## Swiftfox (getswiftfox)"
B="deb http://getswiftfox.com/builds/debian unstable non-free"
echo -e "${A}" "\n${B}" >> ${SOURCES}
chooseDialog
TITLE="Swiftfox installieren"
MESSAGE="Moechtest du auch das Paket (Swiftfox) installieren?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "0" ]; then
sudo apt-get update
dialog --backtitle "Swiftfox-Version" \
--radiolist "Ubuntu Version waehlen" 120 80 60 \
01 "Swiftfox-Athlon64 (AMD64 Hardware mit 64bit OS)" off\
02 "Swiftfox-Athlon64-32bit (AMD64 Hardware mit 32bit OS)" off\
03 "Swiftfox-Prescott (Intel Prescott oder neuer)" off\
04 "Swiftfox-i686 (aeltere AMD und Intel)" on 2>${TMPFILE}
if [ ${?} -ne 0 ]; then return; fi
read RESULT <${TMPFILE}
case ${RESULT} in
01)
SWIFTFOX_VERSION="swiftfox-athlon64"
;;
02)
SWIFTFOX_VERSION="swiftfox-athlon64-32bit"
;;
03)
SWIFTFOX_VERSION="swiftfox-prescott"
;;
04)
SWIFTFOX_VERSION="swiftfox-i686"
;;
*)
SWIFTFOX_VERSION="FEHLER"
;;
esac
if [ ${SWIFTFOX_VERSION} = "FEHLER" ]; then
continue
else
dialog --title " Swiftfox Version waehlen " --yesno "Moechtest du wirklich '${SWIFTFOX_VERSION}' installieren?" 6 44
if [ ${RESULT1} = "0" ]; then
case ${RESULT} in
01)
sudo aptitude install ${SWIFTFOX_VERSION}
;;
02)
sudo aptitude install ${SWIFTFOX_VERSION}
;;
03)
sudo aptitude install ${SWIFTFOX_VERSION}
;;
04)
sudo aptitude install ${SWIFTFOX_VERSION}
;;
*)
continue
;;
esac
fi
fi
fi
;;
\"19\")
grep -iv linux.dropbox ${SOURCES} > ${TMPFILE}
cp -p ${TMPFILE} ${SOURCES}
echo "deb http://linux.dropbox.com/ubuntu maverick main" | sudo tee -a ${SOURCES} > /dev/null
echo "deb-src http://linux.dropbox.com/ubuntu maverick main" | sudo tee -a ${SOURCES} > /dev/null
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 5044912E
chooseDialog
TITLE="Dropbox installieren"
MESSAGE="Moechtest du auch das Paket (nautilus-dropbox) installieren?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "0" ]; then
sudo apt-get update && sudo aptitude install nautilus-dropbox
fi
;;
\"20\")
grep -iv pidgin-developers ${SOURCES} > ${TMPFILE}
cp -p ${TMPFILE} ${SOURCES}
sudo add-apt-repository ppa:pidgin-developers/ppa
chooseDialog
TITLE="Pidgin installieren"
MESSAGE="Moechtest du auch das Paket (Pidgin) installieren?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "0" ]; then
sudo apt-get update && sudo aptitude install pidgin
if [ -f `whereis skype | cut -f 2 -d ' '` ] ; then
sudo aptitude install pidgin-skype
fi
fi
;;
\"21\")
chooseDialog
TITLE="gpm installieren"
MESSAGE="Moechtest du auch das Paket (gpm) installieren?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "0" ]; then
sudo aptitude install gpm
fi
;;
\"22\")
grep -iv claws-mail ${SOURCES} > ${TMPFILE}
cp -p ${TMPFILE} ${SOURCES}
sudo add-apt-repository ppa:claws-mail/ppa
chooseDialog
TITLE="Claws-Mail installieren"
MESSAGE="Moechtest du auch das Paket (claws-mail) installieren?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "0" ]; then
sudo apt-get update && sudo aptitude install claws-mail
fi
;;
\"23\")
grep -iv ferramroberto ${SOURCES} > ${TMPFILE}
cp -p ${TMPFILE} ${SOURCES}
sudo add-apt-repository ppa:ferramroberto/vlc
chooseDialog
TITLE="VLC installieren"
MESSAGE="Moechtest du auch das Paket (vlc) installieren?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "0" ]; then
sudo apt-get update && sudo aptitude install vlc mozilla-plugin-vlc
fi
;;
\"24\")
grep -iv download.skype ${SOURCES} > ${TMPFILE}
cp -p ${TMPFILE} ${SOURCES}
echo "deb http://download.skype.com/linux/repos/debian/ stable non-free #Skype" | sudo tee -a ${SOURCES} > /dev/null
sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 0xd66b746e
chooseDialog
TITLE="Skype installieren"
MESSAGE="Moechtest du auch das Paket (skype) installieren?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "0" ]; then
sudo apt-get update && sudo aptitude install skype earcandy
fi
;;
*)
echo "Fehler?!?!"
;;
esac
done
}
# ubuntu_tweak: In dieser Funktion, kann man mehrere Dinge auswaehlen, die ausgewaehlen Punkte, werden in ein Array
# ... geschrieben und einen nach dem anderen Punkt abgearbeitet.
#
function ubuntu_tweak() {
testConnection
dialog --backtitle "Ubuntu-Tweak" \
--checklist "Ubuntu-Tweak: fuer Ubuntu 10.10" 120 100 60 \
01 "Window Buttons nach rechts verschieben (New Style)" off\
02 "Reset: Window Buttons nach rechts verschieben (Karmic Style)" off\
03 "Aendere den Update Manager - auto Benachrichtigung aus (Jaunty)" off\
04 "Reset: Aendere den Update Manager - auto Benachrichtigung an (vor Jaunty)" off\
05 "Ausschalten des GDM Login-Sound" off\
06 "Reset: Einschalten des GDM Login-Sound" off\
07 "mount-Drive Icons vom Desktop entfernen" off\
08 "Reset: mount-Drive Icons auf dem Desktop anzeigen" off\
09 "Icons im Menue anzeigen" off\
10 "Reset: Icons im Menue entfernen" off\
11 "Ausschalten der GDM Login User Liste" off\
12 "Reset: Einschalten der GDM Login User List" off\
13 "Entferne das ubuntu-docs Packet (252MB)" off\
14 "Reset: Installiere das ubuntu-docs Packet" off\
15 "Aedere den Gnome Kalender, erster Tag der Woche von Sonntag zu Montag" off\
16 "Reset: Aedere den Gnome Kalender, erster Tag der Woche von Montag zu Sonntag" off\
17 "Installiere und Konfiguriere Sharp-Fonts" off\
18 "Reset: Deconfigure Sharp-Fonts" off\
19 "Fix 'apt-get update' fuer Google-Repository" off\
20 "Reset: Fix 'apt-get update' fuer Google-Repository" off\
21 "Auto mount NTFS Partitionen beim Systemstart" off\
22 "Reset: Ausschalten des auto mount für NTFS Partitionen beim Systemstart" off\
23 "Wichtig!!! Grundausstattung (Codecs and Extras) installieren" off\
24 "Firefox optimieren" off\
25 "IPv6 aktivieren (teredo)" off\
26 "IPv6 deaktivieren (teredo)" off\
27 "Sprachdateien im Ubuntu aufraeumen" off\
28 "Wichtige Dateien werden vor dem loeschen geschuetzt (safe-rm)" off 2>${TMPFILE}
if [ ${?} -ne 0 ]; then return; fi
read RESULT <${TMPFILE}
ARRAY=(${RESULT})
chooseDialog
TITLE="Tweak"
MESSAGE="Moechtest du die Aenderungen wirklich durchfuehren?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "1" ]; then return; fi
for I in ${ARRAY[@]}; do
case ${I} in
\"01\")
sudo -u ${ON_USER} DBUS_SESSION_BUS_ADDRESS="${DBUS_SESSION_BUS_ADDRESS}" gconftool-2 --type string --set /apps/metacity/general/button_layout "menu:minimize,maximize,spacer,close"
;;
\"02\")
sudo -u ${ON_USER} "DBUS_SESSION_BUS_ADDRESS="${DBUS_SESSION_BUS_ADDRESS} gconftool-2 --type string --set /apps/metacity/general/button_layout "close,minimize,maximize:"
;;
\"03\")
sudo -u ${ON_USER} "DBUS_SESSION_BUS_ADDRESS="${DBUS_SESSION_BUS_ADDRESS} gconftool -s --type bool /apps/update-notifier/auto_launch false
;;
\"04\")
sudo -u ${ON_USER} "DBUS_SESSION_BUS_ADDRESS="${DBUS_SESSION_BUS_ADDRESS} gconftool -s --type bool /apps/update-notifier/auto_launch true
;;
\"05\")
sudo -u gdm gconftool-2 --set /desktop/gnome/sound/event_sounds --type bool false
sudo -u ${ON_USER} "DBUS_SESSION_BUS_ADDRESS="${DBUS_SESSION_BUS_ADDRESS} gconftool-2 --set /desktop/gnome/sound/event_sounds --type bool false
;;
\"06\")
sudo -u gdm gconftool-2 --set /desktop/gnome/sound/event_sounds --type bool true
sudo -u ${ON_USER} "DBUS_SESSION_BUS_ADDRESS="${DBUS_SESSION_BUS_ADDRESS} gconftool-2 --set /desktop/gnome/sound/event_sounds --type bool true
;;
\"07\")
sudo -u ${ON_USER} "DBUS_SESSION_BUS_ADDRESS="${DBUS_SESSION_BUS_ADDRESS} gconftool -s --type bool /apps/nautilus/desktop/volumes_visible false
;;
\"08\")
sudo -u ${ON_USER} "DBUS_SESSION_BUS_ADDRESS="${DBUS_SESSION_BUS_ADDRESS} gconftool -s --type bool /apps/nautilus/desktop/volumes_visible true
;;
\"09\")
sudo -u ${ON_USER} "DBUS_SESSION_BUS_ADDRESS="${DBUS_SESSION_BUS_ADDRESS} gconftool-2 --set /desktop/gnome/interface/buttons_have_icons --type bool true
sudo -u ${ON_USER} "DBUS_SESSION_BUS_ADDRESS="${DBUS_SESSION_BUS_ADDRESS} gconftool-2 --set /desktop/gnome/interface/menus_have_icons --type bool true
;;
\"10\")
sudo -u ${ON_USER} "DBUS_SESSION_BUS_ADDRESS="${DBUS_SESSION_BUS_ADDRESS} gconftool-2 --set /desktop/gnome/interface/buttons_have_icons --type bool false
sudo -u ${ON_USER} "DBUS_SESSION_BUS_ADDRESS="${DBUS_SESSION_BUS_ADDRESS} gconftool-2 --set /desktop/gnome/interface/menus_have_icons --type bool false
;;
\"11\")
sudo -u gdm gconftool-2 --set --type boolean /apps/gdm/simple-greeter/disable_user_list true
;;
\"12\")
sudo -u gdm gconftool-2 --set --type boolean /apps/gdm/simple-greeter/disable_user_list false
;;
\"13\")
sudo aptitude remove ubuntu-docs
;;
\"14\")
sudo aptitude install ubuntu-docs
;;
\"15\")
TIMEE=$(grep "LC_TIME" /etc/default/locale)
if [ ! ${TIMEE} ]; then
dialog --backtitle "Locale" \
--form " You've selected to change Gnome Calendar first \nday of the week from Sunday to Monday. Please \nenter your country locale (e.g. en__GB, it__IT and \nso on) - required by this tweak. \n\nIf you do not enter a value, \"en__GB\" will be used. " 21 70 18 \
"locale" 4 4 "de_DE" 4 15 20 0\
2>${TMPFILE}
if [ ${?} -ne 0 ]; then return; fi
read TIMEE <${TMPFILE}
dialog --title " Locale eintragen " --yesno "Moechtest du wirklich folgendes wirklich eintragen \n ${TIMEE}" 10 75
TIMEE1=${?}
if [ ${TIMEE1} = "1" ]; then
echo LC_TIME=\"${TIMEE}.UTF-8\" | sudo tee -a /etc/default/locale > /dev/null
dialog --title " Locale wurde gesetzt " --msgbox "\n ${TIMEE}" 10 75
else
echo LC_TIME=\"de_DE.UTF-8\" | sudo tee -a /etc/default/locale > /dev/null
dialog --title " Locale wurde gesetzt " --msgbox "\n de_DE.UTF-8" 10 75
fi
else
echo "You already have custom values for LC_TIME, skipping this tweak"
fi
;;
\"16\")
sudo sed -i '/^LC_TIME.*/d' /etc/default/locale;
;;
\"17\")
testConnection
dialog --title " INFO: Bitte warten " --msgbox "\nDie installation der Sharp Fonts kann einen Moment dauern, abhänig von deiner Internet-Verbindung." 10 50
sudo aptitude install cabextract ttf-droid msttcorefonts
cd /tmp
wget http://sharpfonts.com/fonts/andale32.exe; wget http://sharpfonts.com/fonts/arial32.exe; wget http://sharpfonts.com/fonts/arialb32.exe; wget http://sharpfonts.com/fonts/comic32.exe; wget http://sharpfonts.com/fonts/courie32.exe; wget http://sharpfonts.com/fonts/georgi32.exe; wget http://sharpfonts.com/fonts/impact32.exe; wget http://sharpfonts.com/fonts/tahoma32.exe; wget http://sharpfonts.com/fonts/times32.exe; wget http://sharpfonts.com/fonts/trebuc32.exe; wget http://sharpfonts.com/fonts/verdan32.exe; wget http://sharpfonts.com/fonts/webdin32.exe
if [ ! -d ${TRUETYPEPATH} ]; then
mkdir -p ${TRUETYPEPATH}
fi
cabextract -d /usr/share/fonts/truetype/ andale32.exe arial32.exe arialb32.exe comic32.exe courie32.exe georgi32.exe impact32.exe tahoma32.exe times32.exe trebuc32.exe verdan32.exe webdin32.exe
wget http://sharpfonts.com/fontconfig.tbz && tar xvjpf fontconfig.tbz -C /etc/fonts/
rm -r /tmp/*.exe > /dev/null 2>&1; rm /tmp/fontconfig.tbz > /dev/null 2>&1;
exists() { which "$1" &> /dev/null ; }
if ! [ -d ~/.fonts ] ; then
exec 2>&1
echo 'There is no .fonts directory in your home.'
echo 'Is fontconfig set up for privately installed fonts?'
exit 1
fi
# split up to keep the download command short
DL_HOST=download.microsoft.com
DL_PATH=download/f/5/a/f5a3df76-d856-4a61-a6bd-722f52a5be26
ARCHIVE=PowerPointViewer.exe
URL="http://${DL_HOST}/${DL_PATH}/${ARCHIVE}"
if ! [ -e "${ARCHIVE}" ] ; then
if exists curl ; then curl -O "${URL}"
elif exists wget ; then wget "${URL}"
elif exists fetch ; then fetch "${URL}"
fi
fi
TMPDIR=`mktemp -d`
trap 'rm -rf "$TMPDIR"' EXIT INT QUIT TERM
cabextract -L -F ppviewer.cab -d "${TMPDIR}" "${ARCHIVE}"
cabextract -L -F '*.TT[FC]' -d ~/.fonts "${TMPDIR}/ppviewer.cab"
( cd ~/.fonts && mv cambria.ttc cambria.ttf && chmod 600 \
calibri{,b,i,z}.ttf cambria{,b,i,z}.ttf candara{,b,i,z}.ttf \
consola{,b,i,z}.ttf constan{,b,i,z}.ttf corbel{,b,i,z}.ttf )
fc-cache -fv ~/.fonts
A=""
B=""
C=""
D=""
E="rgb"
F=""
G=""
H=""
I=""
J="true"
K=""
L=""
M=""
N=""
O="hintfull"
P=""
Q=""
R=""
S=""
T="true"
U=""
V=""
W=""
X=""
Y="FixedsysTTF"
Z=""
AA=""
AB="false"
AC=""
AD=""
AE=""
AF=""
AG="Tahoma"
AH=""
AI=""
AJ="9"
AK=""
AL=""
AM="false"
AN=""
AO=""
AP=""
AQ=""
AR="Times New Roman"
AS=""
AT=""
AU="13"
AV=""
AW=""
AX="false"
AY=""
AZ=""
BA=""
BB=""
BC="Courier"
BD="Courier New"
BE="Courier 10 Pitch"
BF=""
BG=""
BH="11"
BI=""
BJ=""
BK="false"
BL=""
BM=""
BN=""
BO=""
BP="Courier New"
BQ="Times New Roman"
BR="Tahoma"
BS="FixedsysTTF"
BT=""
BU=""
BV="hintslight"
BW=""
BX=""
BY="false"
BZ=""
CA=""
CB=""
CC=""
CD="Bitstream Vera Sans"
CE=""
CF=""
CG="Arial"
CH=""
CI=""
CJ=""
CK=""
CL="Helvetica"
CM=""
CN=""
CO="Arial"
CP=""
CQ=""
CR=""
CS=""
CT="Palatino"
CU=""
CV=""
CW="Georgia"
CX=""
CY=""
CZ=""
echo -e "${A}" "\n${B}" "\n${C}" "\n${D}" "\n${E}" "\n${F}" "\n${G}" "\n${H}" "\n${I}" "\n${J}" "\n${K}" "\n${L}" "\n${M}" "\n${N}" "\n${O}" "\n${P}" "\n${Q}" "\n${R}" "\n${S}" "\n${T}" "\n${U}" "\n${V}" "\n${W}" "\n${X}" "\n${Y}" "\n${Z}" "${AA}" "\n${AB}" "\n${AC}" "\n${AD}" "\n${AE}" "\n${AF}" "\n${AG}" "\n${AH}" "\n${AI}" "\n${AJ}" "\n${AK}" "\n${AL}" "\n${AM}" "\n${AN}" "\n${AO}" "\n${AP}" "\n${AQ}" "\n${AR}" "\n${AS}" "\n${AT}" "\n${AU}" "\n${AV}" "\n${AW}" "\n${AX}" "\n${AY}" "\n${AZ}" "${BA}" "\n${BB}" "\n${BC}" "\n${BD}" "\n${BE}" "\n${BF}" "\n${BG}" "\n${BH}" "\n${BI}" "\n${BJ}" "\n${BK}" "\n${BL}" "\n${BM}" "\n${BN}" "\n${BO}" "\n${BP}" "\n${BQ}" "\n${BR}" "\n${BS}" "\n${BT}" "\n${BU}" "\n${BV}" "\n${BW}" "\n${BX}" "\n${BY}" "\n${BZ}" "${CA}" "\n${CB}" "\n${CC}" "\n${CD}" "\n${CE}" "\n${CF}" "\n${CG}" "\n${CH}" "\n${CI}" "\n${CJ}" "\n${CK}" "\n${CL}" "\n${CM}" "\n${CN}" "\n${CO}" "\n${CP}" "\n${CQ}" "\n${CR}" "\n${CS}" "\n${CT}" "\n${CU}" "\n${C}V}" "\n${CW}" "\n${CX}" "\n${CY}" "\n${CZ}" > ~/.fonts.conf
chown ${ON_USER} ~/.fonts.conf
sudo chmod -w /usr/share/fonts -R
A="category truetype"
B="begin /usr/share/fonts/truetype/custom/tahoma.ttf"
C="Family = Tahoma"
D="FontName = Tahoma-Regular"
E="Encoding = Unicode"
F="Location = Magyar Dutch Spanish Czech Russian English Catalan Slovak Italian Turkish Danish Slovenian Basque Portuguese German Polish Swedish Norwegian French Finnish Greek"
G="Charset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-7 ISO8859-9 ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP1251 VISCII1.1-1 TCVN-5712 ISO10646-1"
H="UniCharset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-7 ISO8859-9 ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP1251 VISCII1.1-1 TCVN-5712"
I="GeneralFamily = SansSerif"
J="Weight = Medium"
K="Width = Variable"
L="Shape = NoSerif Upright"
M="Foundry = Microsoft"
N="Priority = 20"
O="end"
P="begin /usr/share/fonts/truetype/custom/tahomabd.ttf"
Q="Family = Tahoma"
R="FontName = Tahoma-Bold"
S="Encoding = Unicode"
T="Location = Magyar Dutch Spanish Czech Russian English Catalan Slovak Italian Turkish Danish Slovenian Basque Portuguese German Polish Swedish Norwegian French Finnish Greek"
U="Charset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-7 ISO8859-9 ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP1251 VISCII1.1-1 TCVN-5712 ISO10646-1"
V="UniCharset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-7 ISO8859-9 ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP1251 VISCII1.1-1 TCVN-5712"
W="GeneralFamily = SansSerif"
X="Weight = Bold"
Y="Width = Variable"
Z="Shape = NoSerif Upright"
AA="Foundry = Microsoft"
AB="Priority = 20"
AC="end"
sudo echo -e "${A}" "\n${B}" "\n${C}" "\n${D}" "\n${E}" "\n${F}" "\n${G}" "\n${H}" "\n${I}" "\n${J}" "\n${K}" "\n${L}" "\n${M}" "\n${N}" "\n${O}" "\n${P}" "\n${Q}" "\n${R}" "\n${S}" "\n${T}" "\n${U}" "\n${V}" "\n${W}" "\n${X}" "\n${Y}" "\n${Z}" "\n${AA}" "\n${AB}" "\n${AC}" > /etc/defoma/hints/custom.hints
sudo dpkg-reconfigure fontconfig
sudo fc-cache -fv
dialog --title " INFO: Installation abgeschlossen " --msgbox "\nDie installation der Sharp Fonts wurde erfolgreich abgeschlossen." 10 50
;;
\"18\")
rm /etc/fonts/alias.conf /etc/fonts/local.conf /etc/fonts/misc.conf /etc/fonts/msfonts-rules.conf ~/.fonts.conf > /dev/null 2>&1;
sudo rm /etc/defoma/hints/custom.hints > /dev/null 2>&1;
;;
\"19\")
echo "Acquire::http::Pipeline-Depth \"0\";" | sudo tee -a /etc/apt/apt.conf.d/90localsettings > /dev/null
;;
\"20\")
sudo rm /etc/apt/apt.conf.d/90localsettings_back > /dev/null 2>&1; sudo cp /etc/apt/apt.conf.d/90localsettings /etc/apt/apt.conf.d/90localsettings_back; sudo sed -i '/^Acquire::http::Pipeline-Depth.*/d' /etc/apt/apt.conf.d/90localsettings_back | sudo sed -i '/^Acquire::http::Pipeline-Depth.*/d' /etc/apt/apt.conf.d/90localsettings; sudo rm /etc/apt/apt.conf.d/90localsettings_back > /dev/null 2>&1;
;;
\"21\")
sudo aptitude install ntfs-3g
if [ $(grep '^[^#].*ntfs-3g' /etc/fstab | wc -l) -gt 0 ]; then
dialog --title " INFO: NTFS-3G wird bereits verwendet " --msgbox "\nNTFS-3G wird auf deinem System bereits verwendet." 10 50
else
NTFSS=$(sudo blkid -c /dev/null -t TYPE=ntfs | cut -d ':' -f 1 > ${TMPFILE})
while read curline; do
DIRR=$(echo ${CURLINE} | cut -c 6- | sed -e 's/\///g')
sudo mkdir /media/${DIRR}
NTFSUUID=$(sudo blkid -c /dev/null -t TYPE=ntfs | grep ${C}urline | cut -d '"' -f 4)
eval "echo UUID=${NTFSUUID} /media/${DIRR} ntfs-3g users 0 0" | sudo tee -a /etc/fstab > /dev/null
done < ${TMPFILE}
fi
rm ${TMPFILE} > /dev/null 2>&1;
dialog --title " INFO: NTFS-3G wurde installiert " --msgbox "\nNTFS-3G wird nun auf deinem System verwendet." 10 50
;;
\"22\")
sudo sed -i '/^UUID.*ntfs-3g.*/d' /etc/fstab;
;;
\"23\")
sudo aptitude install gstreamer0.10-ffmpeg gstreamer0.10-pitfdll gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse gstreamer0.10-plugins-base gstreamer0.10-plugins-good libdvdnav4 libdvdread4 libmp4v2-0 libxine1-ffmpeg ffmpeg flashplugin-nonfree sun-java6-fonts rar unrar p7zip-full p7zip-rar unace unp zip unzip ttf-mscorefonts-installer ttf-liberation mencoder mplayer sun-java6-plugin sun-java6-jre
;;
\"24\")
BASHRC="~/.bashrc"
sed -i '/*MOZ_DISABLE_PANGO.*/d' ${BASHRC}
echo "export MOZ_DISABLE_PANGO=1" >> ${BASHRC}
source ${B}ASHRC
ls -al /usr/bin/sqlite3 &>/dev/null 2>&1
if ! command ; then
# wenn nicht, wird dies installiert
sudo aptitude install sqlite3
fi
pkill -9 firefox*
for f in ~/.mozilla/firefox/*/*sqlite; do sqlite3 ${f} 'VACUUM;'; done
dialog --backtitle "Firefox optimieren" \
--radiolist "Bitte auswaehlen" 30 60 8 \
01 "Schneller Computer / Schnelle Verbindung (> DSL 2000)" off\
02 "Schneller Computer / Langsamere Verbindung (<= DSL 1000)" off\
03 "Schneller Computer / Langsame Verbindung (z.B. ISDN) " off\
04 "Langsamer Computer / Schnelle Verbindung " off\
05 "Langsamer Computer / Langsame Verbindung" on 2>${TMPFILE}
if [ ${?} -ne 0 ]; then return; fi
read RESULT <${TMPFILE}
case ${RESULT} in
01)
A="user_pref(\"network.http.pipelining\", true);"
B="user_pref(\"network.http.pipelining.firstrequest\", true);"
C="user_pref(\"network.http.proxy.pipelining\", true);"
D="user_pref(\"network.http.pipelining.maxrequests\", 10);"
E="user_pref(\"network.http.keep-alive\", true);"
F="user_pref(\"content.notify.backoffcount\", 5);"
G="user_pref(\"content.interrupt.parsing\", true);"
H="user_pref(\"content.max.tokenizing.time\", 2250000);"
I="user_pref(\"content.notify.interval\", 750000);"
J="user_pref(\"content.notify.ontimer\", true);"
K="user_pref(\"content.switch.threshold\", 750000);"
L="user_pref(\"nglayout.initialpaint.delay\", 0);"
M="user_pref(\"network.http.max-connections\", 48);"
N="user_pref(\"network.http.max-connections-per-server\", 32);"
O="user_pref(\"network.http.max-persistent-connections-per-proxy\", 16);"
P="user_pref(\"network.http.max-persistent-connections-per-server\", 8);"
Q="user_pref(\"browser.cache.memory.capacity\", 65536);"
R="user_pref(\"ui.submenuDelay\", 0);"
S="user_pref(\"platform_file_picker\", true);"
T="user_pref(\"layout.spellcheckDefaultlayout.spellcheckDefault\", 2);"
U="user_pref(\"browser.urlbar.autoFill\", true);"
V="user_pref(\"browser.tabs.closeWindowWithLastTab\", false);"
W="user_pref(\"browser.link.open_newwindow.restriction\", 2);"
X="user_pref(\"browser.link.open_newwindow.restriction\", 60000);"
Y="user_pref(\"view_source.editor.external\", true);"
Z="user_pref(\"view_source.editor.path\", /usr/bin/gedit);"
AA="user_pref(\"security.dialog_enable_delay\", 1000);"
BA="user_pref(\"nglayout.initialpaint.delay\", 0);"
cd ~/.mozilla/firefox/*.default/ && echo -e "${A}" "\n${B}" "\n${C}" "\n${D}" "\n${E}" "\n${F}" "\n${G}" "\n${H}" "\n${I}" "\n${J}" "\n${K}" "\n${L}" "\n${M}" "\n${N}" "\n${O}" "\n${P}" "\n${Q}" "\n${R}" "\n${S}" "\n${T}" "\n${U}" "\n${V}" "\n${W}" "\n${X}" "\n${Y}" "\n${Z}" "\n${AA}" "\n${AB}" > user.js
;;
02)
A="user_pref(\"network.http.pipelining\", true);"
B="user_pref(\"network.http.pipelining.firstrequest\", true);"
C="user_pref(\"network.http.proxy.pipelining\", true);"
D="user_pref(\"network.http.pipelining.maxrequests\", 10);"
E="user_pref(\"network.http.keep-alive\", true);"
F="user_pref(\"content.notify.backoffcount\", 5);"
G="user_pref(\"content.max.tokenizing.time\", 2250000);"
H="user_pref(\"content.notify.interval\", 750000);"
I="user_pref(\"content.notify.ontimer\", true);"
J="user_pref(\"content.switch.threshold\", 750000);"
K="user_pref(\"network.http.max-connections\", 48);"
L="user_pref(\"network.http.max-connections-per-server\", 16);"
M="user_pref(\"network.http.max-persistent-connections-per-proxy\", 16);"
N="user_pref(\"network.http.max-persistent-connections-per-server\", 8);"
O="user_pref(\"nglayout.initialpaint.delay\", 0);"
P="user_pref(\"browser.cache.memory.capacity\", 65536);"
Q="user_pref(\"ui.submenuDelay\", 0);"
R="user_pref(\"platform_file_picker\", true);"
S="user_pref(\"layout.spellcheckDefaultlayout.spellcheckDefault\", 2);"
T="user_pref(\"browser.urlbar.autoFill\", true);"
U="user_pref(\"browser.tabs.closeWindowWithLastTab\", false);"
V="user_pref(\"browser.link.open_newwindow.restriction\", 2);"
W="user_pref(\"browser.link.open_newwindow.restriction\", 60000);"
X="user_pref(\"view_source.editor.external\", true);"
Y="user_pref(\"view_source.editor.path\", /usr/bin/gedit);"
Z="user_pref(\"security.dialog_enable_delay\", 1000);"
AA="user_pref(\"nglayout.initialpaint.delay\", 0);"
cd ~/.mozilla/firefox/*.default/ && echo -e "${A}" "\n${B}" "\n${C}" "\n${D}" "\n${E}" "\n${F}" "\n${G}" "\n${H}" "\n${I}" "\n${J}" "\n${K}" "\n${L}" "\n${M}" "\n${N}" "\n${O}" "\n${P}" "\n${Q}" "\n${R}" "\n${S}" "\n${T}" "\n${U}" "\n${V}" "\n${W}" "\n${X}" "\n${Y}" "\n${Z}" "\n${AA}" > user.js
;;
03)
A="user_pref(\"network.http.pipelining\", true);"
B="user_pref(\"network.http.pipelining.firstrequest\", true);"
C="user_pref(\"network.http.proxy.pipelining\", true);"
D="user_pref(\"network.http.pipelining.maxrequests\", 10);"
E="user_pref(\"network.http.keep-alive\", true);"
F="user_pref(\"content.notify.backoffcount\", 5);"
G="user_pref(\"content.interrupt.parsing\", true);"
H="user_pref(\"content.max.tokenizing.time\", 3000000);"
I="user_pref(\"content.maxtextrun\", 8191);"
J="user_pref(\"content.notify.interval\", 750000);"
K="user_pref(\"content.notify.ontimer\", true);"
L="user_pref(\"content.switch.threshold\", 750000);"
M="user_pref(\"network.http.max-connections\", 32);"
N="user_pref(\"network.http.max-connections-per-server\", 8);"
O="user_pref(\"network.http.max-persistent-connections-per-proxy\", 8);"
P="user_pref(\"network.http.max-persistent-connections-per-server\", 4);"
Q="user_pref(\"nglayout.initialpaint.delay\", 0);"
R="user_pref(\"browser.cache.memory.capacity\", 65536);"
S="user_pref(\"ui.submenuDelay\", 0);"
T="user_pref(\"platform_file_picker\", true);"
U="user_pref(\"layout.spellcheckDefaultlayout.spellcheckDefault\", 2);"
V="user_pref(\"browser.urlbar.autoFill\", true);"
W="user_pref(\"browser.tabs.closeWindowWithLastTab\", false);"
X="user_pref(\"browser.link.open_newwindow.restriction\", 2);"
Y="user_pref(\"browser.link.open_newwindow.restriction\", 60000);"
Z="user_pref(\"view_source.editor.external\", true);"
AA="user_pref(\"view_source.editor.path\", /usr/bin/gedit);"
AB="user_pref(\"security.dialog_enable_delay\", 1000);"
AC="user_pref(\"nglayout.initialpaint.delay\", 0);"
cd ~/.mozilla/firefox/*.default/ && echo -e "${A}" "\n${B}" "\n${C}" "\n${D}" "\n${E}" "\n${F}" "\n${G}" "\n${H}" "\n${I}" "\n${J}" "\n${K}" "\n${L}" "\n${M}" "\n${N}" "\n${O}" "\n${P}" "\n${Q}" "\n${R}" "\n${S}" "\n${T}" "\n${U}" "\n${V}" "\n${W}" "\n${X}" "\n${Y}" "\n${Z}" "\n${AA}" "\n${AB}" "\n${AC}" > user.js
;;
04)
A="user_pref(\"network.http.pipelining\", true);"
B="user_pref(\"network.http.pipelining.firstrequest\", true);"
C="user_pref(\"network.http.proxy.pipelining\", true);"
D="user_pref(\"network.http.pipelining.maxrequests\", 10);"
E="user_pref(\"network.http.keep-alive\", true);"
F="user_pref(\"content.notify.backoffcount\", 5);"
G="user_pref(\"content.max.tokenizing.time\", 3000000);"
H="user_pref(\"content.notify.backoffcount\", 5);"
I="user_pref(\"content.notify.interval\", 1000000);"
J="user_pref(\"content.notify.ontimer\", true);"
K="user_pref(\"content.switch.threshold\", 1000000);"
L="user_pref(\"content.maxtextrun\", 4095);"
M="user_pref(\"nglayout.initialpaint.delay\", 1000);"
N="user_pref(\"network.http.max-connections\", 48);"
O="user_pref(\"network.http.max-connections-per-server\", 16);"
P="user_pref(\"network.http.max-persistent-connections-per-proxy\", 16);"
Q="user_pref(\"network.http.max-persistent-connections-per-server\", 8);"
R="user_pref(\"dom.disable_window_status_change\", true);"
S="user_pref(\"platform_file_picker\", true);"
T="user_pref(\"layout.spellcheckDefaultlayout.spellcheckDefault\", 2);"
U="user_pref(\"browser.urlbar.autoFill\", true);"
V="user_pref(\"browser.tabs.closeWindowWithLastTab\", false);"
W="user_pref(\"browser.link.open_newwindow.restriction\", 2);"
X="user_pref(\"browser.link.open_newwindow.restriction\", 60000);"
Y="user_pref(\"view_source.editor.external\", true);"
Z="user_pref(\"view_source.editor.path\", /usr/bin/gedit);"
AA="user_pref(\"security.dialog_enable_delay\", 1000);"
AB="user_pref(\"nglayout.initialpaint.delay\", 100);"
cd ~/.mozilla/firefox/*.default/ && echo -e "${A}" "\n${B}" "\n${C}" "\n${D}" "\n${E}" "\n${F}" "\n${G}" "\n${H}" "\n${I}" "\n${J}" "\n${K}" "\n${L}" "\n${M}" "\n${N}" "\n${O}" "\n${P}" "\n${Q}" "\n${R}" "\n${S}" "\n${T}" "\n${U}" "\n${V}" "\n${W}" "\n${X}" "\n${Y}" "\n${Z}" "\n${AA}" "\n${AB}" > user.js
;;
05)
A="user_pref(\"network.http.pipelining\", true);"
B="user_pref(\"network.http.pipelining.firstrequest\", true);"
C="user_pref(\"network.http.proxy.pipelining\", true);"
D="user_pref(\"network.http.pipelining.maxrequests\", 10);"
E="user_pref(\"network.http.keep-alive\", true);"
F="user_pref(\"content.notify.backoffcount\", 5);"
G="user_pref(\"content.max.tokenizing.time\", 2250000);"
H="user_pref(\"content.notify.interval\", 750000);"
I="user_pref(\"content.notify.ontimer\", true);"
J="user_pref(\"content.switch.threshold\", 750000);"
K="user_pref(\"nglayout.initialpaint.delay\", 750);"
L="user_pref(\"network.http.max-connections\", 32);"
M="user_pref(\"network.http.max-connections-per-server\", 8);"
N="user_pref(\"network.http.max-persistent-connections-per-proxy\", 8);"
O="user_pref(\"network.http.max-persistent-connections-per-server\", 4);"
P="user_pref(\"dom.disable_window_status_change\", true);"
Q="user_pref(\"platform_file_picker\", true);"
R="user_pref(\"layout.spellcheckDefaultlayout.spellcheckDefault\", 2);"
S="user_pref(\"browser.urlbar.autoFill\", true);"
T="user_pref(\"browser.tabs.closeWindowWithLastTab\", false);"
U="user_pref(\"browser.link.open_newwindow.restriction\", 2);"
V="user_pref(\"browser.link.open_newwindow.restriction\", 60000);"
W="user_pref(\"view_source.editor.external\", true);"
X="user_pref(\"view_source.editor.path\", /usr/bin/gedit);"
Y="user_pref(\"security.dialog_enable_delay\", 1000);"
Z="user_pref(\"nglayout.initialpaint.delay\", 100);"
cd ~/.mozilla/firefox/*.default/ && echo -e "${A}" "\n${B}" "\n${C}" "\n${D}" "\n${E}" "\n${F}" "\n${G}" "\n${H}" "\n${I}" "\n${J}" "\n${K}" "\n${L}" "\n${M}" "\n${N}" "\n${O}" "\n${P}" "\n${Q}" "\n${R}" "\n${S}" "\n${T}" "\n${U}" "\n${V}" "\n${W}" "\n${X}" "\n${Y}" "\n${Z}" > user.js
;;
*)
continue
;;
esac
cd ~/Desktop/
;;
\"25\")
sudo aptitude install miredo
sudo /etc/init.d/miredo start
ping6 -c 4 ipv6.google.com
;;
\"26\")
sudo aptitude purge miredo
echo "#disable ipv6" | sudo tee -a /etc/sysctl.conf
echo "net.ipv6.conf.all.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf
echo "net.ipv6.conf.default.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf
echo "net.ipv6.conf.lo.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf
;;
\"27\")
sudo aptitude install localepurge
;;
\"28\")
sudo aptitude install safe-rm
;;
*)
echo "Fehler?!?!"
;;
esac
done
}
# radiolist: die Funktion zum um-schreiben der Ubuntu-Version in der sources.list wird...
# ... momentan auch nicht im Skript verwendet.
#
function radiolist() {
dialog --backtitle "sources.list - Ubuntu Version" \
--radiolist "Ubuntu Version waehlen" 15 50 8 \
01 "jaunty" off\
02 "karmic" off\
03 "lucid" off\
04 "maverick" on 2>${TMPFILE}
if [ ${?} -ne 0 ]; then return; fi
read RESULT <${TMPFILE}
case ${RESULT} in
01)
UBUNTU_VERSION="jaunty"
;;
02)
UBUNTU_VERSION="karmic"
;;
03)
UBUNTU_VERSION="lucid"
;;
04)
UBUNTU_VERSION="maverick"
;;
*)
UBUNTU_VERSION="FEHLER"
;;
esac
if [ $UBUNTU_VERSION = "FEHLER" ]; then
continue
else
chooseDialog
TITLE="Ubuntu Version waehlen"
MESSAGE="Moechtest du wirklich alle sources.list Eintraege auf '${UBUNTU_VERSION}' aendern?"
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --yesno "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
RESULT1=${?}
if [ ${RESULT1} = "1" ]; then return; fi
case ${RESULT} in
01)
sed -i "s/karmic/jaunty/g" ${SOURCES}
sed -i "s/lucid/jaunty/g" ${SOURCES}
sed -i "s/maverick/jaunty/g" ${SOURCES}
;;
02)
sed -i "s/jaunty/karmic/g" ${SOURCES}
sed -i "s/lucid/karmic/g" ${SOURCES}
sed -i "s/maverick/karmic/g" ${SOURCES}
;;
03)
sed -i "s/jaunty/lucid/g" ${SOURCES}
sed -i "s/karmic/lucid/g" ${SOURCES}
sed -i "s/maverick/lucid/g" ${SOURCES}
;;
04)
sed -i "s/jaunty/maverick/g" ${SOURCES}
sed -i "s/karmic/maverick/g" ${SOURCES}
sed -i "s/lucid/maverick/g" ${SOURCES}
;;
*)
continue
;;
esac
fi
}
# aufraemen: auch diese Funktion, zum aufraemen von Ubuntu, wird momentan nicht im Skript verwendet...
# ... um diese wieder aufzunehmen, muss man die Funktion einfach an einer Stelle im Skript aufrufen.
#
function aufraemen() {
chooseDialog
TITLE="APT-Cache"
MESSAGE="APT-Cache aufraumen..."
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --msgbox "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
sudo aptitude autoclean
chooseDialog
TITLE="...aufraumen..."
MESSAGE="nicht mehr benoetigte Abhaengigkeiten aufraumen..."
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --msgbox "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
sudo apt-get autoremove
chooseDialog
TITLE="alte Config-Dateien"
MESSAGE="alte Config-Dateien loeschen..."
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --msgbox "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
echo -e $GELB"alte Config-Dateien loeschen..."$FARBLOS
sudo aptitude purge $OLDCONF
chooseDialog
TITLE="alte Kernel"
MESSAGE="alte Kernel loeschen..."
setDialogDimensions "${MESSAGE}"
dialog --title " ${TITLE} " --msgbox "\n`echo -e "${MESSAGE}"`" ${DIALOG_H} ${DIALOG_W}
sudo aptitude purge $OLDKERNELS
# kann ggf. einkommentiert werden, wenn man den Papierkorb auch geleert haben moechte
# rm -rf /home/*/.local/share/Trash/*/** &> /dev/null
# rm -rf /root/.local/share/Trash/*/** &> /dev/null
}
function repositories_eintragen() {
dialog --backtitle "Repositories eintragen" \
--form " Repositories eintragen - use [up] [down] to select input field " 21 70 18 \
"URL" 2 4 "http://extras.ubuntu.com" 2 15 50 0\
"DISTRO" 4 4 "maverick" 4 15 50 0\
"WAS" 6 4 "main restricted universe multiverse" 6 15 50 0\
2>${TMPFILE}
if [ ${?} -ne 0 ]; then return; fi
N=1
while read RESULT; do
ARRAY[${N}]=${RESULT}
N=`expr ${N} + 1`
done < ${TMPFILE}
dialog --title " Repositories eintragen " --yesno "Moechtest du folgendes wirklich eintragen \n deb ${ARRAY[*]}" 10 75
RESULT1=${?}
if [ ${RESULT1} = "1" ]; then return; fi
grep -iv ${ARRAY[2]} ${SOURCES} > ${TMPFILE}
cp -p ${TMPFILE} ${SOURCES}
echo "deb ${ARRAY[*]}" >> ${SOURCES}
dialog --title "neuer Eintag in der sources.list" \
--msgbox "\n deb ${ARRAY[*]}" 10 75
}
# suckup_sources: diese Funktion wird im Skript momentan nicht verwendet, jedoch bleibt diese noch als Beispiel...
# ... im Skript, da hier eine "Progress-Anzeige" den Download Fortschritt anzeigt... :-)
#
function suckup_sources() {
# check-funktion wird aufgerufen
testConnection
# wenn eine Internet-Verbindung besteht, dann lade die sources.list von suckup.de herunter
if [ ${INTERNET} != "no" ]; then
wget -q http://suckup.de/sources_karmic.txt -O ${TMPFILE} &
WGET_PID=$!
# solange wget laeft, wird dessen Download angezeigt
while [ 1 ]; do
{ for I in $(seq 1 100) ; do
echo ${I}
sleep 0.01
done
echo 100; } | dialog --backtitle "wget - Progress" \
--gauge "Progress" 6 60 0
if [ `ps | grep -c ${WGET_PID}` -eq 0 ]; then
break
fi
done
# wenn die Datei heruntergeladen wurd und nicht leer ist
if [ -e ${TMPFILE} ] && [ -n ${TMPFILE} ]; then
dialog --backtitle "suckup.de - sources.list fuer Ubuntu 10.10 - use [up] [down] to scroll" \
--begin 3 5 --title " File: ${TMPFILE} " \
--textbox ${TMPFILE} 50 140
else
dialog --msgbox "*** ERROR ***\n${TMPFILE} ist nicht vorhanden" 6 42
fi
else
dialog --msgbox "*** ERROR ***\nEs besteht keine Internet-Verbindung." 6 42
fi
}
# main_menu: Dies ist das Hauptmenue, von wo aus neue Funktionen aufgerufen werden koennen
#
function main_menu() {
dialog --backtitle "suckup.de" --title " ubuntu-10.10-tweak - V. ${VERSION} "\
--no-shadow\
--no-cancel\
--menu "Move using [UP] [DOWN], [Enter] to select" 15 80 10\
Repositories "Repositories selber eintragen"\
extra_Repositories "Repositories: fuer Ubuntu 10.10"\
Ubuntu_Tweak "Ubuntu-Einstellungen anpassen"\
Quit "Exit" 2>${TMPFILE}
opt=${?}
if [ ${?} -ne "0" ]; then return; fi
read MENUITEM <${TMPFILE}
case ${MENUITEM} in
Repositories) repositories_eintragen;;
extra_Repositories) launchpad_add;;
Ubuntu_Tweak) ubuntu_tweak;;
Quit) sudo rm ${TMPFILE}; sudo chmod +r ${SOURCES}; exit;;
esac
}
while true; do
main_menu
done
# folgende Dinge sind noch geplant ->
# beschleunigung von Ubuntu
# prelink
# preload
# Gwibber Autostart deaktivieren
#gconftool-2 -s /apps/gwibber/autostart --type=bool false
#
#sudo apt-get -y install fortunes fortunes-de
# Nautilus-Adressleiste - Eingabefeld
#gconftool-2 --type Boolean --set /apps/nautilus/preferences/always_use_location_entry True
# Nautilus-Adressleiste - Navigationssknoepfen
#gconftool-2 --type Boolean --set /apps/nautilus/preferences/always_use_location_entry False
# weitere Beispiele zu "dialog" ->
#dialog --menu "Wähle einen Texteditor" 15 60 10\
# Emacs "Ein sehr mächtiger Texteditor"\
# vi "Ein sehr mächtiger Texteditor für das Terminal"\
# Gedit "Standard-Editor von Gnome"\
# Kile "Standard-Editor von KDE" 2>${TMPFILE}
#read Eingabe <${TMPFILE}
#dialog --msgbox "Sie haben ${E}ingabe gewählt" 0 0
#dialog --backtitle "Interagierendes Dialogprogram" --yesno "Geht es dir gut?" 0 0
#if [ ${?} -eq 0 ]; then
# dialog --msgbox "Das freut mich!" 0 0
#else
# dialog --msgbox "Das tut mir aber leid!" 0 0
#fi