-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
50adae8
commit c8d35c0
Showing
4 changed files
with
94 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#! /bin/bash | ||
|
||
name="agentx-server-1.2-beta" | ||
downloadUrl="https://zhangjiupeng.com/agentx/${name}.tar.gz" | ||
basePath="/usr/local/agentx/" | ||
|
||
clear | ||
echo -e "\n\n\ | ||
_ _ __ __ \n\ | ||
/ \\ __ _ ___ _ __ | |_ \\ \\/ / \n\ | ||
/ _ \\ / _\` |/ _ \\ \`_ \\| __| \\ / \n\ | ||
/ ___ \\ (_| | __/ | | | |_ / \\ \n\ | ||
/_/ \\_\\__, |\\___|_| |_|\\__ /_/\\_\\ \n\ | ||
|___/ \n\ | ||
\n\ | ||
AgentX Server 1.2 Installer \n\ | ||
=========================================" | ||
if [ ! -d "${basePath}" ]; then | ||
echo -e "Create folder \"${basePath}\"" | ||
mkdir "${basePath}" | ||
else | ||
echo -e "Folder \"${basePath}\" exists, please remove before install this program. \n" | ||
exit 1 | ||
fi | ||
|
||
echo "Redirect to ${basePath}" | ||
cd ${basePath} | ||
|
||
echo "Downloading..." | ||
wget -q ${downloadUrl} | ||
|
||
echo "Extracting files..." | ||
tar -xvf ${name}.tar.gz | ||
rm ${name}.tar.gz | ||
|
||
echo -e "\nConfig ${name}" | ||
read -p "port: " port | ||
read -s -p "password: " password | ||
|
||
echo -e "\nMerging ${basePath}${name}/bin/config.json..." | ||
echo -e "\ | ||
{ | ||
\"host\": \"0.0.0.0\",\n\ | ||
\"port\": ${port},\n\ | ||
\"relayPort\": [],\n\ | ||
\"protocol\": \"shadowsocks\",\n\ | ||
\"encryption\": \"aes-256-cfb\",\n\ | ||
\"password\": \"${password}\",\n\ | ||
\"process\": [\"encrypt\"],\n\ | ||
\"dnsCacheCapacity\": 1000,\n\ | ||
\"writeLimit\": 0,\n\ | ||
\"readLimit\": 0\n\ | ||
} | ||
" > ${basePath}${name}/bin/config.json | ||
|
||
echo -e "\nInstall service..." | ||
${basePath}${name}/bin/agentx version | ||
${basePath}${name}/bin/agentx installstart | ||
echo -e "Done!\n" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#! /bin/bash | ||
|
||
name="agentx-server-1.2-beta" | ||
basePath="/usr/local/agentx/" | ||
|
||
clear | ||
echo -e "\n\n\ | ||
_ _ __ __ \n\ | ||
/ \\ __ _ ___ _ __ | |_ \\ \\/ / \n\ | ||
/ _ \\ / _\` |/ _ \\ \`_ \\| __| \\ / \n\ | ||
/ ___ \\ (_| | __/ | | | |_ / \\ \n\ | ||
/_/ \\_\\__, |\\___|_| |_|\\__ /_/\\_\\ \n\ | ||
|___/ \n\ | ||
\n\ | ||
AgentX Server 1.2 Installer \n\ | ||
=========================================" | ||
if [ ! -d "${basePath}" ]; then | ||
echo -e "${name} has already removed. \n" | ||
exit 1 | ||
fi | ||
|
||
echo "Uninstalling..." | ||
${basePath}${name}/bin/agentx remove | ||
|
||
echo "Removing folder..." | ||
rm -r ${basePath} | ||
|
||
echo -e "${name} has been removed.\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters