aboutsummaryrefslogtreecommitdiffstats
path: root/systemd/rhel-import-state
diff options
context:
space:
mode:
authorLukas Nykryn <lnykryn@redhat.com>2013-07-12 13:03:45 +0200
committerLukas Nykryn <lnykryn@redhat.com>2013-07-12 13:03:45 +0200
commit7cda43cae585d3a40e0a2d65992388623093e35f (patch)
treee1dcbaabd5c00b05784f8e34e5981415dafcbe16 /systemd/rhel-import-state
parent4aa178674056dfc0930ad69dd77ec6490d9c5770 (diff)
downloadinitscripts-7cda43cae585d3a40e0a2d65992388623093e35f.tar
initscripts-7cda43cae585d3a40e0a2d65992388623093e35f.tar.gz
initscripts-7cda43cae585d3a40e0a2d65992388623093e35f.tar.bz2
initscripts-7cda43cae585d3a40e0a2d65992388623093e35f.tar.xz
initscripts-7cda43cae585d3a40e0a2d65992388623093e35f.zip
rename fedora-* to rhel-*
Diffstat (limited to 'systemd/rhel-import-state')
-rwxr-xr-xsystemd/rhel-import-state14
1 files changed, 14 insertions, 0 deletions
diff --git a/systemd/rhel-import-state b/systemd/rhel-import-state
new file mode 100755
index 00000000..90c88d53
--- /dev/null
+++ b/systemd/rhel-import-state
@@ -0,0 +1,14 @@
+#!/bin/bash
+# rhel-import-state: import state files from initramfs (e.g. network config)
+
+# exit early if root isn't writeable
+[ -w / ] || exit 0
+
+# copy state into root
+cd /run/initramfs/state
+cp -a -t / .
+
+# run restorecon on the copied files
+if [ -e /sys/fs/selinux/enforce ]; then
+ find . | ( cd /; restorecon -i -f -; ) || :
+fi