#!/bin/bash
way=$(dirname "$0")

if [ ${USER} != root ]; then
    echo "Please run this script as root"
    exit
fi

if [ ${way} != /home/opt ]; then

    cp -r ${way} /home/opt

fi

while :

read -p "Which one you need to install frps and frpc (frps/frpc or none, default is none): " select

do
    case ${select} in

        "frps") 
            cp -f service/frps.service /etc/systemd/system/
            break
        ;;

        "frpc") 
            cp -f service/frpc.service /etc/systemd/system/
            break
        ;;

        "none") 
            break
        ;;

    esac
done