Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
ae871654
Commit
ae871654
authored
Mar 05, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rc: migration glue for <= 15.1.7 installs
parent
7f6507d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
36 deletions
+10
-36
rc
src/etc/rc
+10
-36
No files found.
src/etc/rc
View file @
ae871654
...
@@ -63,7 +63,6 @@ else
...
@@ -63,7 +63,6 @@ else
attempts
=
0
attempts
=
0
while
[
${
mount_rc
}
!=
0
-a
${
attempts
}
-lt
3
]
;
do
while
[
${
mount_rc
}
!=
0
-a
${
attempts
}
-lt
3
]
;
do
/sbin/fsck
-y
/
/sbin/fsck
-y
/
/sbin/fsck
-y
/cf
/sbin/mount
-uw
/ 2>/dev/null
/sbin/mount
-uw
/ 2>/dev/null
mount_rc
=
$?
mount_rc
=
$?
attempts
=
$((
attempts+1
))
attempts
=
$((
attempts+1
))
...
@@ -80,31 +79,13 @@ else
...
@@ -80,31 +79,13 @@ else
done
done
fi
fi
# If /conf is a directory, convert it to a symlink to /cf/conf
# !!! migration code for OPNsense <= 15.1.7, do not remove !!!
if
[
-d
"/conf"
]
;
then
if
[
-d
"/cf/conf"
]
;
then
# If item is not a symlink then rm and recreate
/bin/rm
-f
/conf
CONFPOINTSTO
=
`
readlink
/conf
`
/bin/mv /cf/conf /conf
if
!
test
"x
$CONFPOINTSTO
"
=
"x/cf/conf"
;
then
/bin/rm
-rf
/cf
/bin/rm
-rf
/conf
/bin/ln
-s
/cf/conf /conf
fi
fi
# Check to see if a compact flash mountpoint exists
# If it fails to mount then run a fsck -y
if
grep
-q
cf /etc/fstab
;
then
/sbin/mount
-w
/cf 2>/dev/null
/sbin/mount
-uw
/cf 2>/dev/null
mount_rc
=
$?
attempts
=
0
while
[
${
mount_rc
}
!=
0
-a
${
attempts
}
-lt
3
]
;
do
/sbin/umount /cf
/sbin/fsck
-y
/cf
/sbin/mount
-w
/cf 2>/dev/null
mount_rc
=
$?
attempts
=
$((
attempts+1
))
done
fi
fi
# !!! migration code for OPNsense <= 15.1.7, do not remove !!!
USE_MFS_TMPVAR
=
`
/usr/bin/grep
-c
use_mfs_tmpvar /conf/config.xml
`
USE_MFS_TMPVAR
=
`
/usr/bin/grep
-c
use_mfs_tmpvar /conf/config.xml
`
if
[
"
${
PLATFORM
}
"
=
"nanobsd"
]
||
[
${
USE_MFS_TMPVAR
}
-gt
0
]
;
then
if
[
"
${
PLATFORM
}
"
=
"nanobsd"
]
||
[
${
USE_MFS_TMPVAR
}
-gt
0
]
;
then
...
@@ -126,11 +107,13 @@ fi
...
@@ -126,11 +107,13 @@ fi
# probe for a persistent core dump device
# probe for a persistent core dump device
/usr/local/etc/rc.dumpon
/usr/local/etc/rc.dumpon
# set up config directory structure
/bin/mkdir
-p
/conf/backup
/bin/mkdir
-p
/conf/sshd
# Bootstrap config.xml if necessary
# Bootstrap config.xml if necessary
if
[
!
-f
/conf/config.xml
]
;
then
if
[
!
-f
/conf/config.xml
]
;
then
echo
-n
"Bootstrapping config.xml..."
echo
-n
"Bootstrapping config.xml..."
/bin/mkdir
-p
/conf/backup
/bin/mkdir
-p
/conf/sshd
/bin/cp /usr/local/etc/config.xml /conf/config.xml
/bin/cp /usr/local/etc/config.xml /conf/config.xml
echo
"done."
echo
"done."
fi
fi
...
@@ -201,11 +184,6 @@ fi
...
@@ -201,11 +184,6 @@ fi
/bin/rm
-rf
/var/tmp/
*
/bin/rm
-rf
/var/tmp/
*
echo
-n
"Creating symlinks..."
echo
-n
"Creating symlinks..."
# Make sure symlink is correct on nanobsd
if
[
"
$PLATFORM
"
=
"nanobsd"
]
;
then
/bin/rm /conf
/bin/ln
-s
/cf/conf/ /conf
fi
# Repair symlinks if they are broken
# Repair symlinks if they are broken
if
[
-f
/etc/newsyslog.conf
]
;
then
if
[
-f
/etc/newsyslog.conf
]
;
then
...
@@ -258,10 +236,6 @@ if [ ! -d /var/tmp ]; then
...
@@ -258,10 +236,6 @@ if [ ! -d /var/tmp ]; then
/bin/mkdir
-p
/var/tmp
/bin/mkdir
-p
/var/tmp
fi
fi
if
[
!
-d
/conf/backup/
]
;
then
/bin/mkdir
-p
/conf/backup/
fi
set
-T
set
-T
trap
"echo 'Reboot interrupted'; exit 1"
3
trap
"echo 'Reboot interrupted'; exit 1"
3
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment