SpecialistOff.NET / Вопросы / Статьи / Фрагменты кода / Резюме / Метки / Помощь / Файлы
Список вопросов ПечатьRemiZOffAlex Создано: 2016-10-02 14:45:39.176912 Обновлено: 2016-10-02 14:45:39.176912 |
---|
Через systemd# Firstboot cat <<EOF > /etc/systemd/system/firstboot.service [Unit] Description=Auto-execute post install scripts After=network.target After=mariadb.service Requires=mariadb.service [Service] ExecStart=/root/firstboot.sh [Install] WantedBy=multi-user.target EOF cat <<EOF > /root/firstboot.sh #!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin export PATH # Тело скрипта systemctl disable firstboot.service rm /root/firstboot.sh rm /etc/systemd/system/firstboot.service EOF chmod +x /root/firstboot.sh ## Enable firstboot service systemctl enable firstboot.service |