mirror of
https://github.com/vincenthsu/systemd-ngrok.git
synced 2025-05-16 14:41:40 +00:00
Update install.sh
This commit is contained in:
parent
a319903a4b
commit
9769991086
20
install.sh
20
install.sh
|
@ -21,26 +21,42 @@ if (( $EUID != 0 )); then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
echo "./install.sh <your_authtoken>"
|
echo "./install.sh <your_authtoken> <region> <socks5_port> <PROXY_USER> <PROXY_PASSWORD> <PROXY_PORT>"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -e ngrok.service ]; then
|
if [ ! -e ngrok.service ]; then
|
||||||
git clone --depth=1 https://github.com/safaksoylu/homeip.git
|
git clone --depth=1 https://github.com/safaksoylu/homeip.git
|
||||||
cd systemd-ngrok
|
cd homeip
|
||||||
fi
|
fi
|
||||||
cp ngrok.service /lib/systemd/system/
|
cp ngrok.service /lib/systemd/system/
|
||||||
|
cp socks5.service /lib/systemd/system/
|
||||||
|
|
||||||
mkdir -p /opt/ngrok
|
mkdir -p /opt/ngrok
|
||||||
|
mkdir -p /opt/socks5
|
||||||
|
|
||||||
cp ngrok.yml /opt/ngrok
|
cp ngrok.yml /opt/ngrok
|
||||||
|
cp socks5 /opt/socks5
|
||||||
|
|
||||||
sed -i "s/<add_your_token_here>/$1/g" /opt/ngrok/ngrok.yml
|
sed -i "s/<add_your_token_here>/$1/g" /opt/ngrok/ngrok.yml
|
||||||
sed -i "s/<region>/$2/g" /opt/ngrok/ngrok.yml
|
sed -i "s/<region>/$2/g" /opt/ngrok/ngrok.yml
|
||||||
sed -i "s/<socks5_port>/$3/g" /opt/ngrok/ngrok.yml
|
sed -i "s/<socks5_port>/$3/g" /opt/ngrok/ngrok.yml
|
||||||
|
|
||||||
|
sed -i "s/<PROXY_USER>/$4/g" /lib/systemd/system/socks5.service
|
||||||
|
sed -i "s/<PROXY_PASSWORD>/$5/g" /lib/systemd/system/socks5.service
|
||||||
|
sed -i "s/<PROXY_PORT>/$6/g" /lib/systemd/system/socks5.service
|
||||||
|
|
||||||
cd /opt/ngrok
|
cd /opt/ngrok
|
||||||
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm.zip
|
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm.zip
|
||||||
unzip ngrok-stable-linux-amd64.zip
|
unzip ngrok-stable-linux-amd64.zip
|
||||||
rm ngrok-stable-linux-amd64.zip
|
rm ngrok-stable-linux-amd64.zip
|
||||||
chmod +x ngrok
|
chmod +x ngrok
|
||||||
|
|
||||||
|
cd /opt/socks5
|
||||||
|
chmod +x socks5
|
||||||
|
|
||||||
systemctl enable ngrok.service
|
systemctl enable ngrok.service
|
||||||
systemctl start ngrok.service
|
systemctl start ngrok.service
|
||||||
|
|
||||||
|
systemctl enable socks5.service
|
||||||
|
systemctl start socks5.service
|
||||||
|
|
Loading…
Reference in New Issue
Block a user