Ensure the following requirements are met before proceeding with installation:
- Operating System: Ubuntu
- Permissions: Root or sudo access
To install the migration
bot, execute the following commands:
-
Download and set up the script:
sudo bash -c "$(curl -sL https://raw.githubusercontent.com/erfjab/migration/master/install.sh)" @ install-script
-
Install the bot:
migration install
-
Set up the system service:
migration install-service
-
Start the handler:
migration start
The above steps will:
- Check and Install Dependencies: Ensure all necessary software is installed.
- Clone Repository: Retrieve the
migration
repository securely. - Create Python Environment: Set up an isolated environment for Python packages.
- Create and Enable Service: Register
migration
as a system service. - Launch the Bot: Start the bot, which will run continuously in the background.
grep -o '"secret_key": *"[^"]*"' marzban.json | sed -E 's/.*"secret_key": *"([^"]*)"/\1/'
After installation, you can manage the migration
bot using the following commands:
migration <command>
install
: Set up the bot, including dependencies and initial configuration.start
: Start the bot service.stop
: Stop the bot service.restart
: Restart the bot service.status
: Check the current status of the bot service.logs
: View the bot’s logs in real time.update
: Pull the latest changes from the repository and apply updates.uninstall
: Fully remove the bot and all related files.help
: Display a help message with all available commands.
- Installation Directory:
/opt/erfjab/migration
- Log File:
/opt/erfjab/migration/migration.log
- Service File:
/etc/systemd/system/migration.service
To completely remove migration
and all associated files, execute:
sudo migration uninstall