1#!/bin/bash 2set -e 3set -v 4 5SCRIPT_DIR=$(dirname $(readlink --canonicalize $0)) 6 7# This script must be run with sudo 8 9# The hacksaw group is used to manage access to the 10# hacksawd service 11groupadd hacksaw 12usermod -a -G hacksaw ${SUDO_USER} 13cp ${SCRIPT_DIR}/hacksaw.service /lib/systemd/system/hacksaw.service 14cp ${SCRIPT_DIR}/hacksaw.socket /lib/systemd/system/hacksaw.socket 15chmod 755 /lib/systemd/system/hacksaw.* 16systemctl enable hacksaw.service 17systemctl enable hacksaw.socket 18# hacksaw.socket starts hacksaw.service on-demand 19# so hacksaw.service does not need to be explicitly 20# started 21systemctl start hacksaw.socket 22echo "The installation scripts creates a new 'hacksaw' group and adds you to it." 23echo "You will need to log out and log back in for the group changes to take effect." 24