Merge branches
[grml-etc-core.git] / etc / zsh / zshrc
index c752a63..57af69f 100644 (file)
@@ -3,7 +3,7 @@
 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
 # Bug-Reports:   see http://grml.org/bugs/
 # License:       This file is licensed under the GPL v2.
-# Latest change: Sam Dez 22 19:17:27 CET 2007 [mika]
+# Latest change: Mon Feb 11 18:00:55 CET 2008 [mika]
 ################################################################################
 # This file is sourced only for interactive shells. It
 # should contain commands to set up aliases, functions,
@@ -289,6 +289,11 @@ is43(){
     return 1
 }
 
+# Use is-at-least, if you need to check more precisely.
+# Note that this test will *always* fail, if the is-at-least
+# function could not be marked for autoloading.
+zrcautoload is-at-least || is-at-least() { return 1 }
+
 #f1# Checks whether or not you're running grml
 isgrml(){
     [[ -f /etc/grml_version ]] && return 0
@@ -1357,7 +1362,11 @@ if [[ -r /etc/debian_version ]] ; then
         fi
     }
 
-    isgrmlcd && alias su="sudo -s"          # get a root shell
+    # get a root shell as normal user in live-cd mode:
+    if isgrmlcd && [[ $UID -ne 0 ]] ; then
+       alias su="sudo su"
+     fi
+
     #a1# Take a look at the syslog: \kbd{\$PAGER /var/log/syslog}
     alias llog="$PAGER /var/log/syslog"     # take a look at the syslog
     #a1# Take a look at the syslog: \kbd{tail -f /var/log/syslog}