Created
January 28, 2023 02:50
-
-
Save sumonst21/b17c89555319893c83d42a7f868d575a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script is used to create a systemd service for the chromedriver --verbose --allowed-ips=127.0.0.1 | |
# It is used to run the chromedriver as a service on the server and start it automatically on boot | |
# Create a file called chromedriver.service in /etc/systemd/system/ with the following content | |
CONTENT="[Unit] | |
Description=chromedriver | |
After=network.target | |
[Service] | |
Type=simple | |
User=root | |
ExecStart=/usr/bin/chromedriver --allowed-ips=127.0.0.1 | |
Restart=on-failure | |
RestartSec=5 | |
[Install] | |
WantedBy=multi-user.target" | |
# Create the service file | |
echo "$CONTENT" > /etc/systemd/system/chromedriver.service | |
# Reload the systemd daemon | |
systemctl daemon-reload | |
# Start the service | |
systemctl start chromedriver | |
# Enable the service to start on boot | |
systemctl enable chromedriver | |
# Check the status of the service | |
systemctl status chromedriver |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment