mirror of
https://github.com/teddysun/across.git
synced 2025-01-19 06:19:35 +08:00
Update comments
Signed-off-by: Teddysun <i@teddysun.com>
This commit is contained in:
parent
2f2d75289a
commit
45272a19a2
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||
export PATH
|
||||
#
|
||||
@ -23,12 +23,7 @@ fi
|
||||
ip link delete dummy0 >/dev/null 2>&1
|
||||
|
||||
rand(){
|
||||
index=0
|
||||
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
|
||||
str=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 10 | head -n 1)
|
||||
echo ${str}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||
export PATH
|
||||
#
|
||||
@ -11,12 +11,7 @@ export PATH
|
||||
# https://github.com/xelerance/xl2tpd
|
||||
|
||||
rand(){
|
||||
index=0
|
||||
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
|
||||
str=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 10 | head -n 1)
|
||||
echo ${str}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user