version 1.461, 2015/09/12 14:48:06 |
version 1.462, 2015/09/13 09:22:05 |
|
|
ssh-keygen -A |
ssh-keygen -A |
} |
} |
|
|
# Create Unix sockets directories for X if needed and make sure they have |
# Check filesystems, optionally by using a fsck(8) flag. |
# correct permissions. |
# Usage: do_fsck [-flag] |
setup_X_sockets() { |
|
if [ -d /usr/X11R6/lib ]; then |
|
for d in /tmp/.X11-unix /tmp/.ICE-unix ; do |
|
if [ -d $d ]; then |
|
if [ `ls -ld $d | cut -d' ' -f4` \ |
|
!= root ]; then |
|
chown root $d |
|
fi |
|
if [ `ls -ld $d | cut -d' ' -f1` \ |
|
!= drwxrwxrwt ]; then |
|
chmod 1777 $d |
|
fi |
|
elif [ -e $d ]; then |
|
echo "Error: $d exists and isn't a directory." |
|
else |
|
mkdir -m 1777 $d |
|
fi |
|
done |
|
fi |
|
} |
|
|
|
# Check filesystems, optionally by using a flag for fsck(8) passed as $1. |
|
do_fsck() { |
do_fsck() { |
local _flags=$1 |
fsck -p "$@" |
|
|
fsck -p $_flags |
|
case $? in |
case $? in |
0) |
0) ;; |
|
2) exit 1 |
;; |
;; |
2) |
4) echo "Rebooting..." |
exit 1 |
|
;; |
|
4) |
|
echo "Rebooting..." |
|
reboot |
reboot |
echo "Reboot failed; help!" |
echo "Reboot failed; help!" |
exit 1 |
exit 1 |
;; |
;; |
8) |
8) echo "Automatic file system check failed; help!" |
echo "Automatic file system check failed; help!" |
|
exit 1 |
exit 1 |
;; |
;; |
12) |
12) echo "Boot interrupted." |
echo "Boot interrupted." |
|
exit 1 |
exit 1 |
;; |
;; |
130) |
130) # Interrupt before catcher installed. |
# Interrupt before catcher installed. |
|
exit 1 |
exit 1 |
;; |
;; |
*) |
*) echo "Unknown error; help!" |
echo "Unknown error; help!" |
|
exit 1 |
exit 1 |
;; |
;; |
esac |
esac |
|
|
find . -maxdepth 1 ! -name . ! -name lost+found ! -name quota.user \ |
find . -maxdepth 1 ! -name . ! -name lost+found ! -name quota.user \ |
! -name quota.group ! -name vi.recover -execdir rm -rf -- {} \;) |
! -name quota.group ! -name vi.recover -execdir rm -rf -- {} \;) |
|
|
setup_X_sockets |
# Create Unix sockets directories for X if needed and make sure they have |
|
# correct permissions. |
|
[[ -d /usr/X11R6/lib ]] && mkdir -m 1777 /tmp/.{X11,ICE}-unix |
|
|
[ -f /etc/rc.securelevel ] && sh /etc/rc.securelevel |
[ -f /etc/rc.securelevel ] && sh /etc/rc.securelevel |
# rc.securelevel did not specifically set -1 or 2, so select the default: 1. |
# rc.securelevel did not specifically set -1 or 2, so select the default: 1. |