prog = *argv++;
while ((arg = *argv++) != 0)
if (arg[0] == '-' && arg[1] != 0 && arg[2] == 0) switch (arg[1]) {
+ case 'p':
case 'a': automatic ^= 1; break;
case 'c':
clist = getlist(&argv, "inode");
devgiven = 1;
}
if (!devgiven) {
- printf("Usage: fsck [-acilrsz] file\n");
+ printf("Usage: fsck [-pacilrsz] file\n");
exit(1);
}
return(0);
protocols rc services termcap ttytab utmp rc.cd binary_sizes \
binary_sizes.big binary_sizes.xxl syslog.conf rc.daemons.dist \
rs.inet rs.single make.conf system.conf ttys resolv.conf rc.conf \
- rc.subr man.conf
+ rc.subr man.conf fstab.local
FILES2=shadow
FILES3=daily dhcptags.conf rc
RANDOM_FILE=/usr/adm/random.dat
LOCAL_FILE=/usr/etc/rc.local
+LOCAL_FSTAB=/etc/fstab.local
case "$#:$1" in
1:start|1:stop|1:down)
# Run the daily cleanup on systems that are not on at night.
test -f /usr/etc/daily && sh /usr/etc/daily boot &
+ # Mount non-standard filesystems
+ [ -f $LOCAL_FSTAB ] && cat $LOCAL_FSTAB | grep -v '^#' | while read fsline
+ do set $fsline
+ if [ $# -lt 3 ]; then echo "$LOCAL_FSTAB: short line"; continue; fi
+
+ # This line's parameters
+ dev="$1"; mp="$2"; fstype="$3"
+
+ # Sanity checks
+ if mount | fgrep "$dev"; then echo "$dev mounted."; continue; fi
+ if [ ! -b $dev ]; then echo "$dev missing"; continue; fi
+ if [ ! -d $mp ]; then echo "$mp missing"; continue; fi
+
+ # Do fsck if necessary
+ if shutdown -C
+ then echo "Checking $fstype $dev"
+ if ! fsck.$fstype -p $dev; then echo "$dev fail"; continue; fi
+ fi
+
+ # Do actual mount command
+ echo "$fstype $dev on $mp:"
+ mount -t $fstype $dev $mp
+ done
;;
stop|down)
# Save random data, if /usr is mounted rw.