- # Install ihttpd.path
- ln -fs ../ihttpd.path $initdir$systemdsystemunitdir/sysinit.target.wants/
-
- # Install resolv.conf as resolved service
- #TODO: change this to have a content or depend on systemd-resolved
- if [ -L /etc/resolv.conf ]; then
-
- # Install systemd-resolved
- if [ `readlink /etc/resolv.conf` = '/run/systemd/resolve/resolv.conf' ]; then
-
- # Install resolv.conf as symlink
- ln -fs '/run/systemd/resolve/resolv.conf' $initdir/etc/resolv.conf
-
- # Install systemd-resolved
- inst_multiple \
- $systemdsystemunitdir/systemd-resolved.service \
- $systemdutildir/systemd-resolved \
- /etc/systemd/resolved.conf
-
- # Require systemd-resolve user and group for our ihttpd process
- `egrep -q '^systemd-resolve:' $initdir/etc/group` || egrep '^systemd-resolve:' /etc/group >> "$initdir/etc/group"
- `egrep -q '^systemd-resolve:' $initdir/etc/passwd` || egrep '^systemd-resolve:' /etc/passwd >> "$initdir/etc/passwd"
-
- # Install in ihttpd.service.wants
- ln -fs ../systemd-resolved.service $initdir$systemdsystemunitdir/ihttpd.service.wants/
-
- # Cleanup resolved.conf
- perl -pne 'undef $_ if /^(?:#.*|Domains=|FallbackDNS=|DNS=(?:127.0.0.1|::1)$|$)/;/^DNS=/ && $_ =~ s/(?:127.0.0.1|::1)[ \t]*//g' \
- -i "$initdir/etc/systemd/resolved.conf"
-
- # Cleanup systemd-resolved.service
- perl -pne 'undef $_ if /^(?:#|(?:Wants|After)=org\.freedesktop\.resolve1\.busname)/' \
- -i "$initdir$systemdsystemunitdir/systemd-resolved.service"
-
- # Try install the target file
- else
- inst_simple /etc/resolv.conf
- fi
-
- # Install resolv.conf as file
- elif [ -e /etc/resolv.conf ]; then
-
- # Install resolv.conf as file
- inst_simple /etc/resolv.conf
-
- # Cleanup resolv.conf
- #XXX: strip search, localhost and ipv6
- perl -pne 'undef $_ if /^(?:#.*|search\s+|nameserver\s+127.0.0.1|nameserver\s+[^:\s]+:[^\s]+|$)/' \
- -i "$initdir/etc/resolv.conf"
-
- # Touch resolv.conf file
- else
- # We did what we could
- touch "$initdir/etc/resolv.conf"
- fi
-
- # Install ihttpd log
- ln -fs ../../../run/ihttpd/log/{http,https,child.{askpassword,ihttpd},error}.log $initdir/var/www/html/
-
- # Install in ihttpd.service.wants
- ln -fs ../systemd-networkd.service $initdir$systemdsystemunitdir/ihttpd.service.wants/
- ln -fs ../systemd-tmpfiles-setup.service $initdir$systemdsystemunitdir/ihttpd.service.wants/