home *** CD-ROM | disk | FTP | other *** search
- #! /bin/sh
-
- PATH=/sbin:/etc:/bin:/usr/bin
-
- stty onlcr
-
- echo "Running shutdown script $0:"
-
- case "$0" in
- *0)
- command="halt"
- ;;
- *6)
- command=reboot
- ;;
- *)
- echo "$0: call me as \"rc.0\" or \"rc.6\" please!"
- exit 1
- ;;
- esac
-
- /bin/rm /etc/liz
-
- if [ ! -e /etc/REBOOT ]
- then
- mv /etc/mtab /tmp
- mv /etc/fstab /tmp
-
- if [ ! -d /mnt/C/socd ]
- then
- mkdir /mnt/C/socd
- fi
-
- if [ -e /etc/IPNR ]
- then
- echo "Sichere Systemzustand..."
- if [ `grep -c "/tmp/" /proc/mounts` -ne 0 ]
- then
- if [ `cat "/etc/RUN"` -eq "0" ]
- then
- tar czf /mnt/C/socd/etc.tgz /etc
- elif [ `cat "/etc/RUN"` -eq "1" ]
- then
- tar czf /mnt/C/socd/etc.tgz /etc
- cp /mnt/C/socd/etc.tgz /mnt/C/socd/etc.tgz.old
- elif [ ` cat "/etc/RUN" ` -eq "2" ]
- then
- tar czf /mnt/C/socd/etc.tgz.old /etc
- if [ -e /mnt/C/socd/etc.tgz ]
- then
- rm /mnt/C/socd/etc.tgz
- fi
- elif [ ` cat "/etc/RUN" ` -eq "3" ]
- then
- mv /tmp/C/socd/etc.tgz.old /tmp/C/socd/etc.tgz
- fi
- fi
- fi
-
- mv /tmp/mtab /etc
- mv /tmp/fstab /etc
- fi
-
- killall5 -15
- sleep 5
- killall5 -9
-
-
- umount -a
-
- $command -w
-
- sync
- sleep 1
- wait
-
- if [ "$command" = "reboot" ]; then
- echo "Rebooting."
- reboot
- else
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " **********************************************"
- echo " * *"
- echo " * Now you can switch off your PC *"
- echo " * or reboot with CTRL+ALT+DEL *"
- echo " * *"
- echo " **********************************************"
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- echo " "
- poweroff
- fi
-