#!/bin/sh
#!/bin/sh -xv
#
# Afterboot script from pitz
#
case $1 in
help)
cat <<HELP
afterboot <command>
commands:
help: some short infos about afterboot
all: All commands together"
root: separate home dir for root"
zfs: separate filesystems for pkgsrc and zones"
rcfiles: install rcfiles for tcsh and vim"
password: switch to a better password algorithem"
services: disable services"
HELP
;;
root)
echo "Make a separate home dir for root"
mkdir /root
perl -p -i -e 's/Super-User:\/:\/sbin\/sh/Super-User:\/root:\/sbin\/sh/g' /etc/passwd
;;
zfs)
echo "Separate filesystem for pkgsrc and zones"
# zfs create -o mountpoint=/zones -o quota=30G rpool/ROOT/s10x_u6wos_07b/zones
;;
rcfiles)
echo "Install rcfiles for tcsh, vim"
cat > $HOME/.tcshrc <<-TCSHRC
setenv TERM xterm
setenv PATH /usr/pkg/bin:/usr/pkg/sbin:/usr/sbin:/usr/bin:/opt/SUNWspro/bin:/usr/dt/bin:/usr/openwin/bin:/usr/ccs/bin:/usr/ccs/lib:/usr/sfw/bin:/usr/sfw/sbin
setenv MANPATH /usr/share/man:/usr/pkg/man:/opt/SUNWspro/man
set prompt="%B%n%b@%S%m%s:%/> "
set prompt2="%R?"
set prompt3="CORRECT> %B%R%b (y|n|e)?"
alias ll 'ls -al'
TCSHRC
cat > $HOME/.vimrc <<-VIMRC
set ai nocp digraph ek hid ru sc vb wmnu noeb noet nosol
set bs=2 fo=cqrt ls=2 shm=at tw=72 ww=<,>,h,l
set comments=b:#,:%,n:>
set list listchars=tab:��,trail:�
set viminfo=%,'50,\"100,:100,n~/.viminfo
" Pitz Ergaenzungen
set background=dark
set hlsearch
set ignorecase
VIMRC
cat > $HOME/.zshrc <<-\ZSHRC
setopt no_beep auto_cd complete_in_word correct rm_star_wait
#eval `dircolors`
export CLICOLOR=true
PROMPT='%B%n%b@%S%m%s:%2~> '
RPROMPT='%/'
export EDITOR=vim
export PAGER=less
export RAILS_ENV=development
autoload -U compinit && compinit
alias ls='ls -AF'
alias ll='ls -AFl'
alias lll='ls -AFl@e'
ZSHRC
;;
pkgsrc)
echo "Install package manager pkgsrc"
;;
password)
echo "Set the password algorithem to the more secure blowfish"
cp -p /etc/security/policy.conf /etc/security/policy.conf.orig
perl -p -i -e 's/CRYPT_DEFAULT=__unix__/CRYPT_DEFAULT=2a/g' /etc/security/policy.conf
;;