Update comments

Signed-off-by: Teddysun <i@teddysun.com>
This commit is contained in:
Teddysun 2018-11-07 21:17:07 +09:00
parent 2f2d75289a
commit 45272a19a2
No known key found for this signature in database
GPG Key ID: 09BD4C080AD6C46D
2 changed files with 4 additions and 14 deletions

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/bin/sh
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH export PATH
# #
@ -23,12 +23,7 @@ fi
ip link delete dummy0 >/dev/null 2>&1 ip link delete dummy0 >/dev/null 2>&1
rand(){ rand(){
index=0 str=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 10 | head -n 1)
str=""
for i in {a..z}; do arr[index]=${i}; index=$(expr ${index} + 1); done
for i in {A..Z}; do arr[index]=${i}; index=$(expr ${index} + 1); done
for i in {0..9}; do arr[index]=${i}; index=$(expr ${index} + 1); done
for i in {1..10}; do str="$str${arr[$RANDOM%$index]}"; done
echo ${str} echo ${str}
} }

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/bin/sh
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH export PATH
# #
@ -11,12 +11,7 @@ export PATH
# https://github.com/xelerance/xl2tpd # https://github.com/xelerance/xl2tpd
rand(){ rand(){
index=0 str=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 10 | head -n 1)
str=""
for i in {a..z}; do arr[index]=${i}; index=$(expr ${index} + 1); done
for i in {A..Z}; do arr[index]=${i}; index=$(expr ${index} + 1); done
for i in {0..9}; do arr[index]=${i}; index=$(expr ${index} + 1); done
for i in {1..10}; do str="$str${arr[$RANDOM%$index]}"; done
echo ${str} echo ${str}
} }