update libsodium version
This commit is contained in:
parent
9929effac2
commit
60ae52d386
|
|
@ -24,8 +24,8 @@ plain='\033[0m'
|
||||||
cur_dir=$( pwd )
|
cur_dir=$( pwd )
|
||||||
software=(Shadowsocks-Python ShadowsocksR Shadowsocks-Go Shadowsocks-libev)
|
software=(Shadowsocks-Python ShadowsocksR Shadowsocks-Go Shadowsocks-libev)
|
||||||
|
|
||||||
libsodium_file="libsodium-1.0.11"
|
libsodium_file="libsodium-1.0.12"
|
||||||
libsodium_url="https://github.com/jedisct1/libsodium/releases/download/1.0.11/libsodium-1.0.11.tar.gz"
|
libsodium_url="https://github.com/jedisct1/libsodium/releases/download/1.0.12/libsodium-1.0.12.tar.gz"
|
||||||
|
|
||||||
mbedtls_file="mbedtls-2.4.0"
|
mbedtls_file="mbedtls-2.4.0"
|
||||||
mbedtls_url="https://tls.mbed.org/download/mbedtls-2.4.0-gpl.tgz"
|
mbedtls_url="https://tls.mbed.org/download/mbedtls-2.4.0-gpl.tgz"
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@ export PATH
|
||||||
# Current folder
|
# Current folder
|
||||||
cur_dir=`pwd`
|
cur_dir=`pwd`
|
||||||
|
|
||||||
libsodium_file="libsodium-1.0.11"
|
libsodium_file="libsodium-1.0.12"
|
||||||
libsodium_url="https://github.com/jedisct1/libsodium/releases/download/1.0.11/libsodium-1.0.11.tar.gz"
|
libsodium_url="https://github.com/jedisct1/libsodium/releases/download/1.0.12/libsodium-1.0.12.tar.gz"
|
||||||
|
|
||||||
mbedtls_file="mbedtls-2.4.0"
|
mbedtls_file="mbedtls-2.4.0"
|
||||||
mbedtls_url="https://tls.mbed.org/download/mbedtls-2.4.0-gpl.tgz"
|
mbedtls_url="https://tls.mbed.org/download/mbedtls-2.4.0-gpl.tgz"
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@ export PATH
|
||||||
# Current folder
|
# Current folder
|
||||||
cur_dir=`pwd`
|
cur_dir=`pwd`
|
||||||
|
|
||||||
libsodium_file="libsodium-1.0.11"
|
libsodium_file="libsodium-1.0.12"
|
||||||
libsodium_url="https://github.com/jedisct1/libsodium/releases/download/1.0.11/libsodium-1.0.11.tar.gz"
|
libsodium_url="https://github.com/jedisct1/libsodium/releases/download/1.0.12/libsodium-1.0.12.tar.gz"
|
||||||
|
|
||||||
# Make sure only root can run our script
|
# Make sure only root can run our script
|
||||||
rootness(){
|
rootness(){
|
||||||
|
|
|
||||||
|
|
@ -187,8 +187,8 @@ pre_install(){
|
||||||
# Download files
|
# Download files
|
||||||
download_files(){
|
download_files(){
|
||||||
# Download libsodium file
|
# Download libsodium file
|
||||||
if ! wget --no-check-certificate -O libsodium-1.0.11.tar.gz https://github.com/jedisct1/libsodium/releases/download/1.0.11/libsodium-1.0.11.tar.gz; then
|
if ! wget --no-check-certificate -O libsodium-1.0.12.tar.gz https://github.com/jedisct1/libsodium/releases/download/1.0.12/libsodium-1.0.12.tar.gz; then
|
||||||
echo "Failed to download libsodium-1.0.11.tar.gz!"
|
echo "Failed to download libsodium-1.0.12.tar.gz!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# Download Shadowsocks file
|
# Download Shadowsocks file
|
||||||
|
|
@ -268,15 +268,18 @@ firewall_set(){
|
||||||
# Install Shadowsocks
|
# Install Shadowsocks
|
||||||
install(){
|
install(){
|
||||||
# Install libsodium
|
# Install libsodium
|
||||||
tar zxf libsodium-1.0.11.tar.gz
|
if [ ! -f /usr/lib/libsodium.a ]; then
|
||||||
cd libsodium-1.0.11
|
cd ${cur_dir}
|
||||||
./configure && make && make install
|
tar zxf libsodium-1.0.12.tar.gz
|
||||||
|
cd libsodium-1.0.12
|
||||||
|
./configure --prefix=/usr && make && make install
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "libsodium install failed!"
|
echo "libsodium install failed!"
|
||||||
install_cleanup
|
install_cleanup
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "/usr/local/lib" > /etc/ld.so.conf.d/local.conf
|
fi
|
||||||
|
|
||||||
ldconfig
|
ldconfig
|
||||||
# Install Shadowsocks
|
# Install Shadowsocks
|
||||||
cd ${cur_dir}
|
cd ${cur_dir}
|
||||||
|
|
@ -324,7 +327,7 @@ install(){
|
||||||
# Install cleanup
|
# Install cleanup
|
||||||
install_cleanup(){
|
install_cleanup(){
|
||||||
cd ${cur_dir}
|
cd ${cur_dir}
|
||||||
rm -rf shadowsocks-master.zip shadowsocks-master libsodium-1.0.11.tar.gz libsodium-1.0.11
|
rm -rf shadowsocks-master.zip shadowsocks-master libsodium-1.0.12.tar.gz libsodium-1.0.12
|
||||||
}
|
}
|
||||||
|
|
||||||
# Uninstall Shadowsocks
|
# Uninstall Shadowsocks
|
||||||
|
|
|
||||||
|
|
@ -187,8 +187,8 @@ pre_install(){
|
||||||
# Download files
|
# Download files
|
||||||
download_files(){
|
download_files(){
|
||||||
# Download libsodium file
|
# Download libsodium file
|
||||||
if ! wget --no-check-certificate -O libsodium-1.0.11.tar.gz https://github.com/jedisct1/libsodium/releases/download/1.0.11/libsodium-1.0.11.tar.gz; then
|
if ! wget --no-check-certificate -O libsodium-1.0.12.tar.gz https://github.com/jedisct1/libsodium/releases/download/1.0.12/libsodium-1.0.12.tar.gz; then
|
||||||
echo "Failed to download libsodium-1.0.11.tar.gz!"
|
echo "Failed to download libsodium-1.0.12.tar.gz!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# Download ShadowsocksR file
|
# Download ShadowsocksR file
|
||||||
|
|
@ -276,15 +276,18 @@ EOF
|
||||||
# Install ShadowsocksR
|
# Install ShadowsocksR
|
||||||
install(){
|
install(){
|
||||||
# Install libsodium
|
# Install libsodium
|
||||||
tar zxf libsodium-1.0.11.tar.gz
|
if [ ! -f /usr/lib/libsodium.a ]; then
|
||||||
cd libsodium-1.0.11
|
cd ${cur_dir}
|
||||||
./configure && make && make install
|
tar zxf libsodium-1.0.12.tar.gz
|
||||||
|
cd libsodium-1.0.12
|
||||||
|
./configure --prefix=/usr && make && make install
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "libsodium install failed!"
|
echo "libsodium install failed!"
|
||||||
install_cleanup
|
install_cleanup
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "/usr/local/lib" > /etc/ld.so.conf.d/local.conf
|
fi
|
||||||
|
|
||||||
ldconfig
|
ldconfig
|
||||||
# Install ShadowsocksR
|
# Install ShadowsocksR
|
||||||
cd ${cur_dir}
|
cd ${cur_dir}
|
||||||
|
|
@ -328,7 +331,7 @@ install(){
|
||||||
# Install cleanup
|
# Install cleanup
|
||||||
install_cleanup(){
|
install_cleanup(){
|
||||||
cd ${cur_dir}
|
cd ${cur_dir}
|
||||||
rm -rf manyuser.zip shadowsocksr-manyuser libsodium-1.0.11.tar.gz libsodium-1.0.11
|
rm -rf manyuser.zip shadowsocksr-manyuser libsodium-1.0.12.tar.gz libsodium-1.0.12
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user