Configuring autostart for Linux

If you have installed the latest version ofPureMessage (version 6.4.1) on a Linux machine using systemdas the system and service manager, you can enable the puremessage.service to start automatically.

For existing PMX installations using systemd as system and service manager:

Run the following script, pmx_systemd.sh to enable the puremessage.service to start automatically. You need to run the script as root.
#!/bin/sh

PREFIX=`su -l pmx6 -c "pmx prefix"`;
INIT=$PREFIX/bin/pmx-init;

cat<<EOT > /etc/systemd/system/puremessage.service
[Unit]
Description=Start and Stop PureMessage
After=syslog.target network.target

[Service]
ExecStart=$INIT start
ExecStop=$INIT stop
Type=oneshot
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
EOT

if [ $? -ne 0 ];then
	echo "$0 must be run by root";
else
	echo "The PureMessage system startup program $INIT has now been linked to systemctl service manager."
fi

systemctl enable puremessage

exit