Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ply_client() {
- [ -x /bin/plymouth ] && /bin/plymouth "$@"
- }
- ply_daemon() {
- [ -x /sbin/plymouthd ] && /sbin/plymouthd "$@"
- }
- stat_busy() {
- case "$1" in
- "Mounting Local Filesystems")
- ply_client --newroot=/
- ;;
- "Activating Swap")
- ply_client --sysinit
- ;;
- esac
- ply_client --update="$1"
- ply_client message --text="$1"
- printf "${C_OTHER}${PREFIX_REG} ${C_MAIN}${1}${C_CLEAR} "
- printf "${SAVE_POSITION}"
- deltext
- printf " ${C_OTHER}[${C_BUSY}BUSY${C_OTHER}]${C_CLEAR} "
- }
- stat_fail() {
- ply_client --quit
- deltext
- printf " ${C_OTHER}[${C_FAIL}FAIL${C_OTHER}]${C_CLEAR} \n"
- }
- ply_end(){
- if [ "$0" == "/etc/rc.shutdown" ]; then
- XPID=`pidof X`
- if [ "$XPID" ]; then
- RUNLEVEL=`runlevel`
- if [ "${RUNLEVEL:2:4}" != '5' ]; then
- [ -e /var/run/daemons/slim ] && /etc/rc.d/slim stop
- [ -e /var/run/daemons/gdm ] && /etc/rc.d/gdm stop
- [ -e /var/run/daemons/kdm ] && /etc/rc.d/kdm stop
- [ -e /var/run/daemons/xdm ] && /etc/rc.d/xdm stop
- [ -e /var/run/daemons/entrance ] && /etc/rc.d/entrance stop
- fi
- kill -9 $XPID &> /dev/null
- fi
- ply_daemon --mode=shutdown --pid-file=/tmp/plymouthd
- ply_client --show-splash
- while [[ ( $(ps h $(cat /tmp/plymouthd)) ) && ( $ply_wait -lt 5 ) ]]; do
- ply_wait=$(( $ply_wait + 1 ))
- sleep 1
- done
- [[ $(ps h $(cat /tmp/plymouthd)) ]] && kill -9 $(cat /tmp/plymouthd)
- fi
- ply_client quit --retain-splash
- }
- add_hook multi_end ply_end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement