Skip to content

Commit

Permalink
Change the file download path, like: /tmp/tmp.Kc2NfvhoeF
Browse files Browse the repository at this point in the history
  • Loading branch information
loyess committed Sep 14, 2023
1 parent 26a5d13 commit 094c904
Show file tree
Hide file tree
Showing 19 changed files with 81 additions and 32 deletions.
2 changes: 2 additions & 0 deletions install/cloak_install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
install_cloak(){
cd ${CUR_DIR}
pushd ${TEMP_DIR_PATH} > /dev/null 2>&1
chmod +x ${cloak_file}
mv ${cloak_file} ${CLOAK_SERVER_BIN_PATH}
if [ $? -eq 0 ]; then
Expand All @@ -18,4 +19,5 @@ install_cloak(){
install_cleanup
exit 1
fi
popd > /dev/null 2>&1
}
2 changes: 2 additions & 0 deletions install/goquiet_install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
install_goquiet(){
cd ${CUR_DIR}
pushd ${TEMP_DIR_PATH} > /dev/null 2>&1
chmod +x ${goquiet_file}
mv ${goquiet_file} ${GOQUIET_BIN_PATH}
if [ $? -eq 0 ]; then
Expand All @@ -10,4 +11,5 @@ install_goquiet(){
install_cleanup
exit 1
fi
popd > /dev/null 2>&1
}
2 changes: 2 additions & 0 deletions install/gost_plugin_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ install_gost_plugin(){
if [ ! "$(command -v unzip)" ]; then
package_install "unzip" > /dev/null 2>&1
fi
pushd ${TEMP_DIR_PATH} > /dev/null 2>&1
unzip -oq ${gost_plugin_file}.zip
chmod +x gost-plugin
mv gost-plugin ${GOST_PLUGIN_INSTALL_PATH}
Expand All @@ -15,4 +16,5 @@ install_gost_plugin(){
install_cleanup
exit 1
fi
popd > /dev/null 2>&1
}
2 changes: 2 additions & 0 deletions install/gun_install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
install_gun(){
cd ${CUR_DIR}
pushd ${TEMP_DIR_PATH} > /dev/null 2>&1
chmod +x ${gun_file}
mv ${gun_file} ${GUN_BIN_PATH}
if [ $? -eq 0 ]; then
Expand All @@ -10,4 +11,5 @@ install_gun(){
install_cleanup
exit 1
fi
popd > /dev/null 2>&1
}
2 changes: 2 additions & 0 deletions install/kcptun_install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
install_kcptun(){
cd ${CUR_DIR}
pushd ${TEMP_DIR_PATH} > /dev/null 2>&1
tar zxf ${kcptun_file}.tar.gz
if [ ! -d ${KCPTUN_INSTALL_PATH} ]; then
mkdir -p ${KCPTUN_INSTALL_PATH}
Expand All @@ -21,4 +22,5 @@ install_kcptun(){
install_cleanup
exit 1
fi
popd > /dev/null 2>&1
}
2 changes: 2 additions & 0 deletions install/mos_tls_tunnel_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ install_mos_tls_tunnel(){
if [ ! "$(command -v unzip)" ]; then
package_install "unzip" > /dev/null 2>&1
fi
pushd ${TEMP_DIR_PATH} > /dev/null 2>&1
unzip -oq ${mtt_file}.zip
chmod +x mtt-server
mv mtt-server ${MTT_BIN_PATH}
Expand All @@ -15,4 +16,5 @@ install_mos_tls_tunnel(){
install_cleanup
exit 1
fi
popd > /dev/null 2>&1
}
2 changes: 2 additions & 0 deletions install/qtun_install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
install_qtun(){
cd ${CUR_DIR}
pushd ${TEMP_DIR_PATH} > /dev/null 2>&1
tar xf ${qtun_file}.tar.xz
if [ ! -d ${QTUN_INSTALL_PATH} ]; then
mkdir -p ${QTUN_INSTALL_PATH}
Expand All @@ -13,4 +14,5 @@ install_qtun(){
install_cleanup
exit 1
fi
popd > /dev/null 2>&1
}
2 changes: 2 additions & 0 deletions install/rabbit_tcp_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ install_rabbit_tcp(){
if [ ! "$(command -v gunzip)" ]; then
package_install "gunzip" > /dev/null 2>&1
fi
pushd ${TEMP_DIR_PATH} > /dev/null 2>&1
gunzip -q ${rabbit_file}.gz
chmod +x ${rabbit_file}
mv ${rabbit_file} ${RABBIT_BIN_PATH}
Expand All @@ -23,4 +24,5 @@ install_rabbit_tcp(){
install_cleanup
exit 1
fi
popd > /dev/null 2>&1
}
6 changes: 6 additions & 0 deletions install/shadowsocks_install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
install_shadowsocks_libev(){
cd ${CUR_DIR}
pushd ${TEMP_DIR_PATH} > /dev/null 2>&1
tar zxf ${shadowsocks_libev_file}.tar.gz
cd ${shadowsocks_libev_file}
./configure --disable-documentation && make && make install
Expand All @@ -19,10 +20,12 @@ install_shadowsocks_libev(){
install_cleanup
exit 1
fi
popd > /dev/null 2>&1
}

install_shadowsocks_rust(){
cd ${CUR_DIR}
pushd ${TEMP_DIR_PATH} > /dev/null 2>&1
tar xf ${shadowsocks_rust_file}.tar.xz
chmod +x ssservice
mv ssservice ${SHADOWSOCKS_RUST_INSTALL_PATH}
Expand All @@ -42,6 +45,7 @@ install_shadowsocks_rust(){
install_cleanup
exit 1
fi
popd > /dev/null 2>&1
}

install_go_shadowsocks2(){
Expand All @@ -51,6 +55,7 @@ install_go_shadowsocks2(){
package_install "gunzip" > /dev/null 2>&1
fi

pushd ${TEMP_DIR_PATH} > /dev/null 2>&1
gunzip -q ${go_shadowsocks2_file}.gz
chmod +x ${go_shadowsocks2_file}
mv ${go_shadowsocks2_file} ${GO_SHADOWSOCKS2_BIN_PATH}
Expand All @@ -70,4 +75,5 @@ install_go_shadowsocks2(){
install_cleanup
exit 1
fi
popd > /dev/null 2>&1
}
2 changes: 2 additions & 0 deletions install/simple_obfs_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ install_simple_obfs(){
simple_obfs_ver=$(wget --no-check-certificate -qO- https://api.github.com/repos/shadowsocks/simple-obfs/releases | grep -o '"tag_name": ".*"' | head -n 1| sed 's/"//g;s/v//g' | sed 's/tag_name: //g')
[ -z ${simple_obfs_ver} ] && _echo -e "获取 simple-obfs 最新版本失败." && exit 1

pushd ${TEMP_DIR_PATH} > /dev/null 2>&1
git clone https://github.com/shadowsocks/simple-obfs.git
[ -d simple-obfs ] && cd simple-obfs || _echo -e "git clone simple-obfs 失败."
git submodule update --init --recursive
Expand Down Expand Up @@ -32,4 +33,5 @@ install_simple_obfs(){
fi
[ -f ${SIMPLE_OBFS_BIN_PATH} ] && ln -fs ${SIMPLE_OBFS_BIN_PATH} /usr/bin
_echo -i "simple-obfs-${simple_obfs_ver} 安装成功."
popd > /dev/null 2>&1
}
2 changes: 2 additions & 0 deletions install/simple_tls_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ install_simple_tls(){
if [ ! "$(command -v unzip)" ]; then
package_install "unzip" > /dev/null 2>&1
fi
pushd ${TEMP_DIR_PATH} > /dev/null 2>&1
unzip -oq ${simple_tls_file}.zip
chmod +x simple-tls
mv simple-tls ${SIMPLE_TLS_INSTALL_PATH}
Expand All @@ -15,4 +16,5 @@ install_simple_tls(){
install_cleanup
exit 1
fi
popd > /dev/null 2>&1
}
2 changes: 2 additions & 0 deletions install/v2ray_plugin_install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
install_v2ray_plugin(){
cd ${CUR_DIR}
pushd ${TEMP_DIR_PATH} > /dev/null 2>&1
tar zxf ${v2ray_plugin_file}.tar.gz
if [ ! -d ${V2RAY_PLUGIN_INSTALL_PATH} ]; then
mkdir -p ${V2RAY_PLUGIN_INSTALL_PATH}
Expand All @@ -13,4 +14,5 @@ install_v2ray_plugin(){
install_cleanup
exit 1
fi
popd > /dev/null 2>&1
}
2 changes: 2 additions & 0 deletions install/xray_plugin_install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
install_xray_plugin(){
cd ${CUR_DIR}
pushd ${TEMP_DIR_PATH} > /dev/null 2>&1
tar zxf ${xray_plugin_file}.tar.gz
if [ ! -d ${XRAY_PLUGIN_INSTALL_PATH} ]; then
mkdir -p ${XRAY_PLUGIN_INSTALL_PATH}
Expand All @@ -13,4 +14,5 @@ install_xray_plugin(){
install_cleanup
exit 1
fi
popd > /dev/null 2>&1
}
34 changes: 3 additions & 31 deletions ss-plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1363,6 +1363,8 @@ install_step_all(){
install_status
disable_selinux
install_prepare
TEMP_DIR_PATH=$(mktemp -d)
trap "rm -rf $TEMP_DIR_PATH; exit" 2
improt_package "utils" "dependencies.sh"
install_dependencies_logic
improt_package "utils" "downloads.sh"
Expand All @@ -1388,37 +1390,7 @@ install_step_all(){

install_cleanup(){
cd "${CUR_DIR}"
# ss-libev
rm -rf "${LIBSODIUM_FILE}" "${LIBSODIUM_FILE}.tar.gz"
rm -rf "${MBEDTLS_FILE}" "${MBEDTLS_FILE}.tar.gz"
rm -rf "${shadowsocks_libev_file}" "${shadowsocks_libev_file}.tar.gz"

# ss-rust
rm -rf "${shadowsocks_rust_file}.tar.xz" sslocal ssserver ssurl ssmanager

# v2ray-plugin
rm -rf "${v2ray_plugin_file}.tar.gz"

# kcptun
rm -rf "client_linux_${ARCH}" "${kcptun_file}.tar.gz"

# simple-obfs
rm -rf simple-obfs

# mos-tls-tunnel
rm -rf "${mtt_file}.zip" LICENSE README.md mtt-client

#simple-tls
rm -rf "${simple_tls_file}.zip" LICENSE README.md README_zh.md README_en.md

# gost-plugin
rm -rf "${gost_plugin_file}.zip"

# xray-plugin
rm -rf "${xray_plugin_file}.tar.gz"

# qtun
rm -rf qtun-client "${qtun_file}.tar.xz"
rm -rf ${TEMP_DIR_PATH}
}

do_uid(){
Expand Down
7 changes: 6 additions & 1 deletion utils/ck_user_manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -323,17 +323,22 @@ del_unrestricted_users_logic_cade(){
download_ck_clinet(){
local CK_CLIENT_V=$1

cd ${CUR_DIR}
# Download cloak client
local cloak_file="ck-client-linux-${ARCH}-v${CK_CLIENT_V}"
local cloak_url="https://github.com/cbeuw/Cloak/releases/download/v${CK_CLIENT_V}/ck-client-linux-${ARCH}-v${CK_CLIENT_V}"
TEMP_DIR_PATH=$(mktemp -d)
trap "rm -rf $TEMP_DIR_PATH; exit" 2
pushd ${TEMP_DIR_PATH} > /dev/null 2>&1
improt_package "utils" "downloads.sh"
download "${cloak_file}" "${cloak_url}"

# install ck-client
cd ${CUR_DIR}
chmod +x ${cloak_file}
mv ${cloak_file} ${CLOAK_CLIENT_BIN_PATH}
[ -f ${CLOAK_CLIENT_BIN_PATH} ] && ln -fs ${CLOAK_CLIENT_BIN_PATH} /usr/bin
popd > /dev/null 2>&1
install_cleanup
}

ck2_users_manager(){
Expand Down
4 changes: 4 additions & 0 deletions utils/dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ install_libsodium(){
local installStatus=$1

cd ${CUR_DIR}
pushd ${TEMP_DIR_PATH} > /dev/null 2>&1
_echo -i "下载${LIBSODIUM_FILE}."
download "${LIBSODIUM_FILE}.tar.gz" "${LIBSODIUM_URL}"
_echo -i "解压${LIBSODIUM_FILE}."
Expand All @@ -143,6 +144,7 @@ install_libsodium(){
install_cleanup
exit 1
fi
popd > /dev/null 2>&1
# wriet version num
if [ ! -d "$(dirname ${LIBSODIUM_VERSION_FILE})" ]; then
mkdir -p $(dirname ${LIBSODIUM_VERSION_FILE})
Expand Down Expand Up @@ -170,6 +172,7 @@ install_mbedtls(){
local installStatus=$1

cd ${CUR_DIR}
pushd ${TEMP_DIR_PATH} > /dev/null 2>&1
_echo -i "下载${MBEDTLS_FILE}."
download "${MBEDTLS_FILE}.tar.gz" "${MBEDTLS_URL}"
_echo -i "解压${MBEDTLS_FILE}."
Expand All @@ -184,6 +187,7 @@ install_mbedtls(){
install_cleanup
exit 1
fi
popd > /dev/null 2>&1
# wriet version num
if [ ! -d "$(dirname ${MBEDTLS_VERSION_FILE})" ]; then
mkdir -p $(dirname ${MBEDTLS_VERSION_FILE})
Expand Down
Loading

0 comments on commit 094c904

Please sign in to comment.