Fix issue: improvement

This commit is contained in:
Edi Septriyanto
2024-07-07 22:38:50 +07:00
parent 87e3d672fb
commit 255d433202
4 changed files with 25 additions and 20 deletions

View File

@@ -22,7 +22,7 @@
#CMD_NAME="adduser"
# Make sure only root can access and not direct access.
if ! declare -F "requires_root" &>/dev/null; then
if [[ "$(type -t requires_root)" != "function" ]]; then
echo "Direct access to this script is not permitted."
exit 1
fi

View File

@@ -29,10 +29,10 @@ echo ""
# Network speed test benchmark.
echo "### Network Speedtest Benchmark ###"
cachefly=$( wget -q -O /dev/null http://cachefly.cachefly.net/100mb.test 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
cachefly=$( wget -q -O /dev/null https://cachefly.cachefly.net/100mb.test 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from CacheFly: $cachefly "
leaseweb=$( wget -q -O /dev/null http://mirror.leaseweb.com/speedtest/100mb.bin 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from Leaseweb, Haarlem, NL: $leaseweb "
ovh=$( wget -q -O /dev/null https://proof.ovh.net/files/100Mb.dat 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from OVH: $ovh "
linodeatl=$( wget -q -O /dev/null http://speedtest.atlanta.linode.com/100MB-atlanta.bin 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from Linode, Atlanta, GA: $linodeatl "
@@ -49,13 +49,5 @@ echo "Download speed from Linode, Tokyo, JP: $linodejp "
linodesgp=$( wget -q -O /dev/null http://speedtest.singapore.linode.com/100MB-singapore.bin 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from Linode, Singapore, SGP: $linodesgp "
slsea=$( wget -q -O /dev/null http://speedtest.sea01.softlayer.com/downloads/test100.zip 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from Softlayer, Seattle, WA: $slsea "
slsjc=$( wget -q -O /dev/null http://speedtest.sjc01.softlayer.com/downloads/test100.zip 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from Softlayer, San Jose, CA: $slsjc "
sldal=$( wget -q -O /dev/null http://speedtest.dal05.softlayer.com/downloads/test100.zip 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from Softlayer, Dallas, TX: $sldal "
slwdc=$( wget -q -O /dev/null http://speedtest.wdc01.softlayer.com/downloads/test100.zip 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from Softlayer, Washington, DC: $slwdc "
slsng=$( wget -q -O /dev/null http://speedtest.sng01.softlayer.com/downloads/test100.zip 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from Softlayer, Singapore: $slsng "
vodafone=$( wget -q -O /dev/null http://212.183.159.230/100MB.zip 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}' )
echo "Download speed from Vodafone: $vodafone "

View File

@@ -2,12 +2,25 @@
# Fix file permission
# Min. Requirement : GNU/Linux Ubuntu 18.04
# Last Build : 17/07/2019
# Last Build : 07/07/2024
# Author : MasEDI.Net (me@masedi.net)
# Since Version : 1.0.0
# directory
[ "${1}" = "" ] && return 0
# Make sure only root can access and not direct access.
if [[ "$(type -t requires_root)" != "function" ]]; then
echo "Direct access to this script is not permitted."
exit 1
fi
find "${1}" -type d -print0 | xargs -0 chmod 755
find "${1}" -type f -print0 | xargs -0 chmod 644
# Usage: fixpermission path
function fixpermission() {
# Path file / directory
[ "${1}" = "" ] && return 0
find "${1}" -type d -print0 | xargs -0 chmod 755
find "${1}" -type f -print0 | xargs -0 chmod 644
}
# Start running things from a call at the end so if this script is executed
# after a partial download it doesn't do anything.
fixpermission "$@"

View File

@@ -22,7 +22,7 @@
#CMD_NAME="sslgen"
# Make sure only root can access and not direct access.
if ! declare -F "requires_root" &>/dev/null; then
if [[ "$(type -t requires_root)" != "function" ]]; then
echo "Direct access to this script is not permitted."
exit 1
fi