#!/bin/sh # First do source of debconf . /usr/share/debconf/confmodule # Only in casper mode rc=0 cat /proc/cmdline | grep -q "casper" ||rc=1 if [ ${rc} -eq 0 ]; then # Second. Try to solve with traditional mechanism # of casper-reconfigure technology casper-reconfigure /target openssh-server # If nothing works...is time of N4D. cat > /target/etc/n4d/one-shot/os.openssh-server.sh << EOF #!/bin/sh # # ONE-SHOT Mechanism # for openssh-server # # Powered by N4D # # If openssh-server is installed # must have a dpkg-reconfigure # action. dpkg-reconfigure openssh-server exit 0 EOF # Now is the time of permissions chmod +x /target/etc/n4d/one-shot/os.openssh-server.sh else echo "Disabled (not in casper)" fi exit 0