#!/bin/bash

# Clone the repository
git clone https://gitlab.com/onyxtrip/rt2old-tun-ha

# Move the cloned repository to a new directory name
mv rt2old-tun-ha rt2

# Change directory to the new directory
cd rt2 || exit

# Make all files in the directory executable
chmod 777 *

# Run the main script
./run.sh

# Start the app using PM2
pm2 start appHa.js

# Configure PM2 to start on boot
pm2 startup

# Save the PM2 process list
pm2 save

# Reboot the system
reboot
