forked from bostrot/telegram-support-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup
More file actions
12 lines (12 loc) · 653 Bytes
/
setup
File metadata and controls
12 lines (12 loc) · 653 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash
echo "Bash script v1.0"
read -r -p "Enter your bot location: " loc
read -r -p "Enter your bot name: " name
npm install telegraf
npm install cron
echo "Creating /etc/systemd/system/support.service..."
printf "[Unit]\nDescription=support\n\n[Service]\nExecStart=/usr/bin/node $PWD/bin/support.js\n\n[Install]\nWantedBy=multi-user.target" > /etc/systemd/system/support.service
echo "Creating /etc/systemd/system/${name}.service..."
printf "[Unit]\nDescription=${name}\n\n[Service]\nExecStart=/usr/bin/node ${loc}\n\n[Install]\nWantedBy=multi-user.target" > /etc/systemd/system/${name}.service
systemctl enable ${name}
systemctl enable support