#!/bin/bash # rhel-import-state: import state files from initramfs (e.g. network config) # copy state into root cd /run/initramfs/state find . -mindepth 1 -maxdepth 1 -exec cp -av -t / {} \; # run restorecon on the copied files if [ -e /sys/fs/selinux/enforce ]; then find . -mindepth 1 -print0 | { cd / && xargs --null restorecon -i; } fi