21 lines
589 B
Bash
Executable File
21 lines
589 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# TODO: Make sure this is executed from within its original directory!
|
|
|
|
virtualenv ./venv
|
|
. ./venv/bin/activate
|
|
pip install -r requirements.txt
|
|
|
|
# Prepare a systemd service unit file with current pwd and user data
|
|
USER=`id -un`
|
|
GROUP=`id -gn`
|
|
PWD=`pwd`
|
|
|
|
cp ftpbot.service.example ftpbot.service
|
|
sed -i "s#%USER%#$USER#g" ftpbot.service
|
|
sed -i "s#%GROUP%#$GROUP#g" ftpbot.service
|
|
sed -i "s#%PWD%#$PWD#g" ftpbot.service
|
|
|
|
echo "Put ftpbot.servive within /etc/systemd/system and use systemctl to configure the service."
|
|
echo "You can use register_service.sh to do this via sudo."
|