#!/bin/sh mkdir -p /var/run/hald/hald-local mkdir -p /var/run/hald/hald-runner config() { NEW="$1" OLD="`dirname $NEW`/`basename $NEW .new`" # If there's no config file by that name, mv it over: if [ ! -r $OLD ]; then mv $NEW $OLD elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy rm $NEW fi # Otherwise, we leave the .new copy for the admin to consider... } config etc/rc.d/rc.hald.new config etc/dbus-1/system.d/hal.conf.new # If the haldaemon user/group don't exist, add them: if ! grep -q haldaemon /etc/group; then groupadd haldaemon fi if ! grep -q haldaemon /etc/passwd; then useradd -g haldaemon -d / -c "Hal Daemon" -s /bin/false haldaemon fi ### # Use rc.local to start dbus at boot. ### PIDFILE=/var/run/dbus/dbus.pid if [ ! -e etc/rc.d/rc.local ]; then echo "#!/bin/sh" > etc/rc.d/rc.local chmod 755 etc/rc.d/rc.local fi run=`grep "sh /etc/rc.d/rc.messagebus" etc/rc.d/rc.local` if [[ "${run}" == "" ]]; then echo "" >> etc/rc.d/rc.local echo "if [ -x /etc/rc.d/rc.messagebus ]; then" >> etc/rc.d/rc.local echo " if [ -w $PIDFILE ]; then" >> etc/rc.d/rc.local echo " rm $PIDFILE" >> etc/rc.d/rc.local echo " fi" >> etc/rc.d/rc.local echo " sh /etc/rc.d/rc.messagebus start" >> etc/rc.d/rc.local echo "fi" >> etc/rc.d/rc.local fi # if rc.hal is executable, run it on startup run=`grep ". /etc/rc.d/rc.hald" etc/rc.d/rc.local` if [[ "${run}" == "" ]]; then cat << EOF >> etc/rc.d/rc.local #hal # To disable hal, chmod rc.hal to 644 if [ -x /etc/rc.d/rc.hald ]; then sh /etc/rc.d/rc.hald start fi EOF fi ( echo -e "\E[0;32m+--------------------------------------------------------------------------------------+\E[0;0m" ) ( echo -e "\E[0;32m| Done. It's needed to create an HAL dedicated mounters group.. |\E[0;0m" ) ( echo -e "\E[0;32m| |\E[0;0m" ) ( echo -e "\E[0;32m| # groupadd mounters |\E[0;0m" ) ( echo -e "\E[0;32m| |\E[0;0m" ) ( echo -e "\E[0;32m| Now. It's needed to edit /etc/group and add all desired user |\E[0;0m" ) ( echo -e "\E[0;32m| |\E[0;0m" ) ( echo -e "\E[0;32m| mounters:x:105:user1,user2,user3 |\E[0;0m" ) ( echo -e "\E[0;32m| |\E[0;0m" ) ( echo -e "\E[0;32m| Now. Edit /etc/dbus-1/system.d/hal.conf |\E[0;0m" ) ( echo -e "\E[0;32m| |\E[0;0m" ) ( echo -e "\E[0;32m| |\E[0;0m" ) ( echo -e "\E[0;32m| |\E[0;0m" ) ( echo -e "\E[0;32m| |\E[0;0m" ) ( echo -e "\E[0;32m| |\E[0;0m" ) ( echo -e "\E[0;32m| |\E[0;0m" ) ( echo -e "\E[0;32m| |\E[0;0m" ) ( echo -e "\E[0;32m| |\E[0;0m" ) ( echo -e "\E[0;32m| |\E[0;0m" ) ( echo -e "\E[0;32m| Replace *105* with your mounters group number |\E[0;0m" ) ( echo -e "\E[0;32m| |\E[0;0m" ) ( echo -e "\E[0;32m| Now. Edit /etc/udev/rules.d/udev.rules |\E[0;0m" ) ( echo -e "\E[0;32m| Uncomment #RUN+="socket:/org/freedesktop/hal/udev_event" |\E[0;0m" ) ( echo -e "\E[0;32m| Like RUN+="socket:/org/freedesktop/hal/udev_event" |\E[0;0m" ) ( echo -e "\E[0;32m| Save and restart all service and KDE or restart pc |\E[0;0m" ) ( echo -e "\E[0;32m| |\E[0;0m" ) ( echo -e "\E[0;32m| # /etc/rc.d/rc.messagebus start |\E[0;0m" ) ( echo -e "\E[0;32m| # /etc/rc.d/rc.hal start |\E[0;0m" ) ( echo -e "\E[0;32m| # /etc/rc.d/rc.udev reload |\E[0;0m" ) ( echo -e "\E[0;32m+--------------------------------------------------------------------------------------+\E[0;0m" )