root_arg="$my_ip:/srv/fai/nfsroot:vers=3"
# fai-setup without -e sets the ip to the local_ip/local_network, eg 192.168.1.3/24
# I restrict it to one ip as simple but imperfect access control.
- sed -ri --follow-symlinks '\%^/srv/fai/%d' /etc/exports
- cat >>/etc/exports <<EOF
+
+ # we may chattr +i /etc/exports if we dun want it modified
+ # for example, if we made these exports more widely available
+ # while doing multiple installs or a recovery.
+ if [[ -w /etc/exports ]]; then
+ sed -ri --follow-symlinks '\%^/srv/fai/%d' /etc/exports
+ cat >>/etc/exports <<EOF
/srv/fai/config $ip(async,ro,no_subtree_check)
/srv/fai/nfsroot $ip(async,ro,no_subtree_check,no_root_squash)
EOF
- exportfs -ra
+ exportfs -ra
+ fi
systemctl start nfs-server # assumes recent os
else
std_arg="-u http://faiserver:8080/config.tar.gz"