diff options
Diffstat (limited to 'etc/rc')
-rwxr-xr-x | etc/rc | 60 |
1 files changed, 30 insertions, 30 deletions
@@ -22,6 +22,33 @@ export HOME PATH # Set our operating platform PLATFORM=`cat /etc/platform` +# Mount memory file system if it exists +echo -n "Mounting filesystems..." +/sbin/mount -a + +# Mount /. If it fails run a fsck. +if [ ! "$PLATFORM" = "cdrom" ] ; then + /sbin/mount -a || (/sbin/fsck -fy; /sbin/mount -a) + + # If /conf is a directory, convert it to a symlink + # to /cf/conf + if [ -d "/conf" ]; then + # If item is not a symlink then rm and recreate + CONFPOINTSTO=`readlink /conf` + if ! test "x$CONFPOINTSTO" = "x/cf/conf"; then + rm -rf /conf + ln -s /cf/conf /conf + fi + fi +fi + +# Check to see if a compact flash mountpoint exists +# If it fails to mount then run a fsck -fy +if grep -q cf /etc/fstab; then + /sbin/mount -uw /cf || \ + (/sbin/umount /cf; /sbin/fsck -fy /cf; /sbin/mount -w /cf) +fi + # Set our current version version=`cat /etc/version` @@ -41,9 +68,9 @@ if [ "$PLATFORM" = "pfSense" ]; then mdmfs -S -M -s 4m md /var/run fi -product=`cat /etc/inc/globals.inc | grep product_name | cut -d'"' -f4` -hideplatform=`cat /etc/inc/globals.inc | grep hideplatform | wc -l` -varrunpath=`cat /etc/inc/globals.inc | grep varrun_path | cut -d'"' -f4` +product=`grep product_name /etc/inc/globals.inc | cut -d'"' -f4` +hideplatform=`grep hideplatform /etc/inc/globals.inc | wc -l` +varrunpath=`grep varrun_path /etc/inc/globals.inc | cut -d'"' -f4` if [ "$hideplatform" -gt "0" ]; then platformbanner="" # hide the platform @@ -61,33 +88,6 @@ echo # Enable console output if its muted. /sbin/conscontrol mute off >/dev/null -# Mount memory file system if it exists -echo -n "Mounting filesystems..." -/sbin/mount -a - -# Mount /. If it fails run a fsck. -if [ ! "$PLATFORM" = "cdrom" ] ; then - /sbin/mount -uw / || (/sbin/fsck -fy; /sbin/mount -uw /) - - # If /conf is a directory, convert it to a symlink - # to /cf/conf - if [ -d "/conf" ]; then - # If item is not a symlink then rm and recreate - CONFPOINTSTO=`readlink /conf` - if ! test "x$CONFPOINTSTO" = "x/cf/conf"; then - rm -rf /conf - ln -s /cf/conf /conf - fi - fi -fi - -# Check to see if a compact flash mountpoint exists -# If it fails to mount then run a fsck -fy -if grep -q cf /etc/fstab; then - /sbin/mount -uw /cf || \ - (/sbin/umount /cf; /sbin/fsck -fy /cf; /sbin/mount -w /cf) -fi - if [ "$PLATFORM" = "cdrom" ] ; then # do nothing for cdrom platform elif [ "$PLATFORM" = "embedded" ] ; then |