diff options
author | root <root@dasajuma.(none)> | 2010-09-02 10:26:04 +0200 |
---|---|---|
committer | root <root@dasajuma.(none)> | 2010-09-02 10:26:04 +0200 |
commit | 8e0d211bf674953f2830830e27cb80a8b720ef17 (patch) | |
tree | a7814d6dd37b84476628e51d9fcb5f3ea98bba8e /config/chroot_local-hooks/hotfixes.sh | |
download | kanotix-8e0d211bf674953f2830830e27cb80a8b720ef17.zip kanotix-8e0d211bf674953f2830830e27cb80a8b720ef17.tar.gz |
Initial commit
Diffstat (limited to 'config/chroot_local-hooks/hotfixes.sh')
-rwxr-xr-x | config/chroot_local-hooks/hotfixes.sh | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/config/chroot_local-hooks/hotfixes.sh b/config/chroot_local-hooks/hotfixes.sh new file mode 100755 index 0000000..f5d006e --- /dev/null +++ b/config/chroot_local-hooks/hotfixes.sh @@ -0,0 +1,57 @@ +#!/bin/sh +if [ "$(id -u)" != 0 ]; then + echo Error: You must be root to run this script! + exit 1 +fi + +# re-enable powerbutton +if [ -f /etc/powersave/events ]; then + sed -i 's/^\(EVENT_BUTTON_POWER=\).*/\1"wm_shutdown"/' /etc/powersave/events + pidof powersaved >/dev/null && /etc/init.d/powersaved restart +fi + +# vim tuning +if [ -d /etc/vim ]; then + rm -f /etc/vim/vimrc.local +cat <<EOT > /etc/vim/vimrc.local +syntax on +set background=dark +set showmatch " Show matching brackets. +set pastetoggle=<F10> +EOT +fi + +# fix kdm/gdm/xdm/wdm startup +for x in kdm gdm xdm wdm; do + if [ -x /etc/init.d/$x ]; then + update-rc.d -f $x remove + update-rc.d $x start 99 5 . stop 01 0 1 2 3 4 6 . + fi +done + +# init 5 as default +sed -i s/id:.:initdefault:/id:5:initdefault:/ /etc/inittab + +# enable textlogins for runlevel 4/5 +sed -i 's/\([1-6]:23\):/\145:/' /etc/inittab + +insserv live-config + +# workarounds to fix old kanotix installs +rm -f /etc/profile /etc/environment +cp /usr/share/base-files/profile /etc +rm -rf /etc/sysconfig + +# rm/cp/mv aliases and bash completion for login shell +cat <<EOT >> /etc/profile + +# enable bash completion in interactive shells +if [ -f /etc/bash_completion ]; then + . /etc/bash_completion +fi + +# Some more alias to avoid making mistakes: +alias rm='rm -i' +alias cp='cp -i' +alias mv='mv -i' +EOT |