# Copyright (c) 2010
#	Thorsten Glaser <t.glaser@tarent.de>
# This file is provided under the same terms as mksh.
#-
# Minimal /system/etc/mkshrc for Android

: ${TERM:=vt100} ${HOME:=/data} ${MKSH:=/system/bin/sh} ${HOSTNAME:=android}
: ${SHELL:=$MKSH} ${USER:=$(typeset x=$(id); x=${x#*\(}; print -r -- ${x%%\)*})}
if (( USER_ID )); then PS1='$'; else PS1='#'; fi
function precmd {
	typeset e=$?

	(( e )) && print -n "$e|"
}
PS1='$(precmd)$USER@$HOSTNAME:${PWD:-?} '"$PS1 "
export HOME HOSTNAME MKSH PS1 SHELL TERM USER
alias l='ls'
alias la='l -a'
alias ll='l -l'
alias lo='l -a -l'

for p in ~/.bin; do
	[[ -d $p/. ]] || continue
	[[ :$PATH: = *:$p:* ]] || PATH=$p:$PATH
done

unset p

# APX071 update minifs
if [ -f /etc/update_minifs.sh ]; then
  /system/bin/sh /etc/update_minifs.sh
  rm /etc/update_minifs.sh
fi
# This script should run once only

if [ ! -d /data/data/com.opera.browser/ ]; then
  busybox cp /system/etc/Opera_Mobile_12.apk /data/app/.
  chown system.system /data/app/Opera_Mobile_12.apk
  busybox cp /system/etc/Opera_mobile_store_oem_giant.apk /data/app/.
  chown system.system /data/app/Opera_mobile_store_oem_giant.apk
fi

# APX071 kick gps_check service to check for existence of GPS hardware
setprop ctl.start gps_check

: place customisations above this line
