useful_scripts/create_systemd_service.sh

19 lines
297 B
Bash
Executable File

# $1 - name of service
# $2 - description of service
# $3 path to script
cat << EOF >> /lib/systemd/system/$1.service
[Unit]
Description=$2
After=network-online.target
[Service]
ExecStart=$3
Type=Oneshot
StandardOutput=journal
[Install]
WantedBy=multi-user.target
EOF
systemctl enable --now $1