#!/bin/sh # # Startup/shutdown script for the mirror service. # create_run_dir() { if [ ! -d /run/mirror/ ]; then mkdir -p /run/mirror chown :mirror /run/mirror chmod g+wX /run/mirror fi } start() { echo "Starting Mirror service" create_run_dir daemon \ --name=mirror \ --user=mirror \ --pidfiles=/run/mirror \ --output=/var/log/mirror/mirror.log \ -- mirror } stop() { echo "Stopping Mirror service" /usr/bin/daemon --name=mirror --pidfiles=/run/mirror --stop } status() { /usr/bin/daemon --name=mirror --pidfiles=/run/mirror --running --verbose } case "$1" in start) start ;; stop) stop ;; status) status ;; *) echo "Usage: $0 {start|stop|status}" exit 1 esac