1# $MirSecuCron$ 2# $MirOS: src/etc/profile,v 1.66 2009/11/15 11:49:17 tg Exp $ 3 4PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/mpkg/bin 5umask 022 6[ -z "$KSH_VERSION$ZSH_VERSION" ] && alias print='echo -e' 7: ${HOME:=/} ${OSNAME:=MirBSD} 8export HOME PATH 9[ -s "$HOME/.profile.preinit" ] && . $HOME/.profile.preinit 10 11[ -z "$TERM" -o x"$TERM" = x"unknown" ] && if [ -x /usr/bin/tset ]; then 12 x=$(ulimit -c 0; /usr/bin/tset -sQ \?vt220) 13 TERM=vt100 14 eval $x 15else 16 TERM=vt220 17fi 18stty newcrt werase '^W' intr '^C' kill '^U' erase '^?' status '^T' 19 20if [ -n "$USER" ]; then 21 PATH=~/.etc/bin:/usr/local/bin:/usr/mpkg/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/sbin:/sbin:/usr/mpkg/sbin:/usr/games 22 PS1='$ ' 23fi 24_shellok= 25BROWSER=lynx 26CVSUMASK=002 27EDITOR=/bin/ed 28IRCNAME="MirOS packages a kernel, userland and the attitude" 29IRCPORT=6667 30IRCSERVER=irc.eu.freenode.net 31LC_CTYPE=en_US.UTF-8 32PAGER=/usr/bin/less 33if [ -n "$KSH_VERSION" ]; then 34 test -z "$USER" || PS1="\$PWD $PS1" 35 alias which='whence -p' 36 _shellok=1 37elif [ -n "$BASH_VERSION" ]; then 38 set -o emacs 39 shopt -s extglob 40 [[ $TERM = screen ]] && \ 41 X_COLOUR=$X_COLOUR'[1;36;40m\]screen:\[' 42 if [[ $OSTYPE = linux-gnu || $OSTYPE = Linux ]]; then 43 # compat_linux(8) 44 PS1='\['$X_COLOUR'[31m\]Linux!\[[0m\]\u@\h:\w \$ ' 45 [[ -e /emul/linux/bin/ls ]] && alias ls='/bin/ls --color' 46 else 47 # native via ports 48 PS1='\['$X_COLOUR'[34m\]bash!\[[0m\]\u@\h:\w \$ ' 49 fi 50 [[ -n $NOCOLOURPROMPT ]] && PS1='bash:\u@\h:\w \$ ' 51 _shellok=1 52elif [ -n "$ZSH_VERSION" ]; then 53 PS1='%n@%m:%~ %# ' 54 if [[ -n $NOCOLOURPROMPT ]]; then 55 PS1='zsh:'$PS1 56 RPS1='%(?..%?)' 57 else 58 PS1='%B%F{4}zsh!%f%b'$PS1 59 RPS1='%(?..%B%F{1}%?%f%b)' 60 fi 61 _shellok=1 62fi 63XDG_CACHE_HOME=$HOME/.etc/xdg/cache 64XDG_CONFIG_HOME=$HOME/.etc/xdg/config 65XDG_DATA_HOME=$HOME/.etc/xdg/data 66export BROWSER CVSUMASK EDITOR HOME IRCNAME IRCPORT IRCSERVER LC_CTYPE OSNAME 67export PAGER PS1 TERM XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME 68unset HISTFILE NOCOLOURPROMPT x 69test -n "$_shellok" || return 0 70unset _shellok 71[[ -n $KSH_VERSION$ZSH_VERSION ]] && alias cls='print -n \\033c' 72# convenience aliases and functions: 73[[ -x /emul/linux/bin/bash ]] && alias lx='/emul/linux/bin/bash --login' 74function bye { 75 [[ $1 = k ]] && ssh-agent -k 76 typeset M='\033c' 77 [ $? -ne 0 ] && M='\033c Warning: ssh-agent returned error!\n' 78 print -n -- "$M" 79 exit 80 logout 81} 82function ge { # German ⇄ English 83 $BROWSER "http://dict.leo.org/?search=$*" 84} 85 86if [ -O /var/run/ssh-agent/$USER_ID ]; then 87 _dir=/var/run/ssh-agent/$USER_ID 88 # If the agent is not running, remove stale files 89 [[ -e $_dir/socket ]] || rm -f $_dir/{agent,keyread} 90 # Start ssh-agent if it is not already started 91 [[ -e $_dir/agent || -S $SSH_AUTH_SOCK ]] || \ 92 (cd /; ssh-agent -s -a $_dir/socket) >$_dir/agent 93 # Do the following only if ssh-agent is running 94 if [[ -e $_dir/socket ]]; then 95 # Read configuration file if it exists 96 [[ -s $_dir/agent ]] && . $_dir/agent >&2 97 # Read in the keys, if not already done 98 [[ -e $_dir/keyread ]] || ssh-add | tee $_dir/keyread 99 fi 100 unset _dir 101fi 102 103: $MirOS: src/etc/profile,v 1.66 2009/11/15 11:49:17 tg Exp $ 104