aboutsummaryrefslogtreecommitdiffstats
path: root/systemd/rhel-import-state
blob: 90c88d53e0b2660709b9d52ba79499fd24c3e477 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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