Petr Šabata f5bf49
#!/bin/sh
Petr Šabata f5bf49
Petr Šabata f5bf49
# More details about systemd generator:
Petr Šabata f5bf49
# http://www.freedesktop.org/wiki/Software/systemd/Generators/
Petr Šabata f5bf49
Petr Šabata f5bf49
. /usr/lib/kdump/kdump-lib.sh
DistroBaker 624a64
. /usr/lib/kdump/kdump-logger.sh
Petr Šabata f5bf49
Petr Šabata f5bf49
# If invokded with no arguments for testing purpose, output to /tmp to
Petr Šabata f5bf49
# avoid overriding the existing.
Petr Šabata f5bf49
dest_dir="/tmp"
Petr Šabata f5bf49
Petr Šabata f5bf49
if [ -n "$1" ]; then
Petr Šabata f5bf49
    dest_dir=$1
Petr Šabata f5bf49
fi
Petr Šabata f5bf49
Petr Šabata f5bf49
systemd_dir=/usr/lib/systemd/system
Petr Šabata f5bf49
kdump_wants=$dest_dir/kdump.service.wants
Petr Šabata f5bf49
Petr Šabata f5bf49
if is_ssh_dump_target; then
Petr Šabata f5bf49
    mkdir -p $kdump_wants
Petr Šabata f5bf49
    ln -sf $systemd_dir/network-online.target $kdump_wants/
Petr Šabata f5bf49
fi