#!/bin/sh
# chroot_perl.sh

doas mkdir -p /var/www/htdocs/perl/
doas mkdir -p /var/www/usr/{bin,lib,libexec,libdata}
doas cp /usr/bin/perl /var/www/usr/bin/
doas cp -p /usr/lib/lib{c,m,perl,pthread,util,z}.so* /var/www/usr/lib/
doas cp /usr/libexec/ld.so /var/www/usr/libexec/
doas cp -R /usr/libdata/perl5 /var/www/usr/libdata/
doas mkdir -p /var/www/{tmp,dev}
doas chown www:daemon /var/www/tmp
doas touch /var/www/dev/null
doas chmod +x /root/chroot_perl.sh

doas chown -R www:daemon /var/www/htdocs/perl/
doas chmod +x /var/www/htdocs/perl/index.pl