#!/bin/sh # This script is licensed under # GPL v3 or higher. get_syslog() { # TODO get the /var/log/syslog file and send it to # the client host # Dummy action logger -t "[n4d4d-loggercatcher]" "Copying to host" cp /var/log/syslog /tmp/ } clean_logs() { logger -t "[n4d4d-loggercatcher]" "Service syslog restart" service rsyslog stop service rsyslog start } usage() { echo "USAGE $0 [get|clean]" exit 0 } ACTION="$1" case $ACTION in get) get_syslog ;; clean) clean_logs ;; *) usage ;; esac exit 0