#!/bin/sh # post-install script for Debian Slash'EM # # Peter Makholm (peter@makholm.net) 19991103 # This script is released under GPLv2 or later # set -e . /usr/share/debconf/confmodule if [ -d /var/lib/games/slashem ] ; then if [ -d /var/games/slashem ] ; then echo "Warning:"; echo "Only /var/games/slashem/ should exist but /var/lib/games/slashem also"; echo "exists. Please fix it."; else echo -n "Moving /var/lib/games/slashem to /var/games/slashem... " mv /var/lib/games/slashem /var/games/slashem; echo "done." fi fi # Make needed directories if [ ! -d /var/games/slashem ] ; then mkdir -p /var/games/slashem fi chown root:games /var/games/slashem chmod 0775 /var/games/slashem if [ ! -d /var/games/slashem/save ] ; then mkdir /var/games/slashem/save fi chown root:games /var/games/slashem/save chmod 0775 /var/games/slashem/save # Make needed files touch /var/games/slashem/perm chown root:games /var/games/slashem/perm chmod 0664 /var/games/slashem/perm touch /var/games/slashem/record chown root:games /var/games/slashem/record chmod 0664 /var/games/slashem/record touch /var/games/slashem/logfile chown root:games /var/games/slashem/logfile chmod 0664 /var/games/slashem/logfile # Automatically added by dh_installinit/13.14.1 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -z "${DPKG_ROOT:-}" ] && [ -x "/etc/init.d/slashem-common" ]; then update-rc.d slashem-common start 80 S . >/dev/null invoke-rc.d --skip-systemd-native slashem-common start || exit 1 fi fi # End automatically added section # Automatically added by dh_installsystemd/13.14.1 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then # The following line should be removed in trixie or trixie+1 deb-systemd-helper unmask 'slashem-common.service' >/dev/null || true # was-enabled defaults to true, so new installations run enable. if deb-systemd-helper --quiet was-enabled 'slashem-common.service'; then # Enables the unit on first installation, creates new # symlinks on upgrades if the unit file has changed. deb-systemd-helper enable 'slashem-common.service' >/dev/null || true else # Update the statefile to add new symlinks (if any), which need to be # cleaned up on purge. Also remove old symlinks. deb-systemd-helper update-state 'slashem-common.service' >/dev/null || true fi fi # End automatically added section # Automatically added by dh_installsystemd/13.14.1 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -d /run/systemd/system ]; then systemctl --system daemon-reload >/dev/null || true if [ -n "$2" ]; then _dh_action=restart else _dh_action=start fi deb-systemd-invoke $_dh_action 'slashem-common.service' >/dev/null || true fi fi # End automatically added section