62 lines
1.6 KiB
Bash
62 lines
1.6 KiB
Bash
#!/bin/sh
|
|
[ -f /etc/banner ] && cat /etc/banner
|
|
[ -e /tmp/.failsafe ] && cat /etc/banner.failsafe
|
|
fgrep -sq '/ overlay ro,' /proc/mounts && {
|
|
echo 'Your JFFS2-partition seems full and overlayfs is mounted read-only.'
|
|
echo 'Please try to remove files from /overlay/upper/... and reboot!'
|
|
}
|
|
|
|
export PATH="%PATH%"
|
|
export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
|
|
export HOME=${HOME:-/root}
|
|
export PS1='\u@\h:\w\$ '
|
|
export GOROOT="/usr/share/golang/"
|
|
|
|
[ -x /bin/more ] || alias more=less
|
|
[ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi
|
|
|
|
[ -z "$KSH_VERSION" -o \! -s /etc/mkshrc ] || . /etc/mkshrc
|
|
|
|
[ -x /usr/bin/arp ] || arp() { cat /proc/net/arp; }
|
|
[ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
|
|
|
|
[ -n "$FAILSAFE" ] || {
|
|
for FILE in /etc/profile.d/*.sh; do
|
|
[ -e "$FILE" ] && . "$FILE"
|
|
done
|
|
unset FILE
|
|
}
|
|
[ -x /bin/ll ] || alias ll='ls -al'
|
|
|
|
ulimit -c unlimited
|
|
|
|
DBUS_SESSION_FILE=/tmp/dbus-session.env
|
|
|
|
#if [ ! -f $DBUS_SESSION_FILE ]; then
|
|
# echo "Setup Session" >> /tmp/sh.log
|
|
# dbus-daemon --session --print-address >> $DBUS_SESSION_FILE &
|
|
# sync
|
|
#fi
|
|
|
|
#if [ -f $DBUS_SESSION_FILE ]; then
|
|
# echo "Setup Session Env" >> /tmp/sh.log
|
|
# DBUS_SESSION_ENV=`cat $DBUS_SESSION_FILE`
|
|
# export DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_ENV
|
|
#else
|
|
# echo "Don't find Session" >> /tmp/sh.log
|
|
#fi
|
|
|
|
# add by huangxin
|
|
if [ -x /tmp/dbus_env.sh ]
|
|
then
|
|
source /tmp/dbus_env.sh
|
|
else
|
|
if [ -x /usr/bin/dbus-launch ]; then
|
|
export $(dbus-launch)
|
|
echo "export DBUS_SESSION_BUS_ADDRESS=\"$DBUS_SESSION_BUS_ADDRESS\"" > /tmp/dbus_env.sh
|
|
echo "export DBUS_SESSION_BUS_PID=\"$DBUS_SESSION_BUS_PID\"" >> /tmp/dbus_env.sh
|
|
|
|
chmod +x /tmp/dbus_env.sh
|
|
fi
|
|
fi
|