useful_scripts/create_systemd_service.sh

19 lines
297 B
Bash
Raw Normal View History

2024-02-22 17:08:28 +00:00
# $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