mirror of
https://github.com/RROrg/rr.git
synced 2025-06-21 05:51:05 +08:00
新增生成随机数字的函数 genRandomDigit
This commit is contained in:
parent
c41636090a
commit
3b1e4ff40b
@ -76,6 +76,13 @@ function randomhex() {
|
|||||||
printf "%02X" $((RANDOM % 255 + 1))
|
printf "%02X" $((RANDOM % 255 + 1))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Generate a random digit (0-9A-Z)
|
||||||
|
function genRandomDigit() {
|
||||||
|
echo {0..9} | tr ' ' '\n' | sort -R | head -1
|
||||||
|
}
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Generate a random letter
|
# Generate a random letter
|
||||||
function genRandomLetter() {
|
function genRandomLetter() {
|
||||||
@ -429,7 +436,6 @@ function connectwlanif() {
|
|||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Find and mount the DSM root filesystem
|
# Find and mount the DSM root filesystem
|
||||||
# (based on pocopico's TCRP code)
|
|
||||||
function findDSMRoot() {
|
function findDSMRoot() {
|
||||||
local DSMROOTS=""
|
local DSMROOTS=""
|
||||||
[ -z "${DSMROOTS}" ] && DSMROOTS="$(mdadm --detail --scan 2>/dev/null | grep -E "name=SynologyNAS:0|name=DiskStation:0|name=SynologyNVR:0|name=BeeStation:0" | awk '{print $2}' | uniq)"
|
[ -z "${DSMROOTS}" ] && DSMROOTS="$(mdadm --detail --scan 2>/dev/null | grep -E "name=SynologyNAS:0|name=DiskStation:0|name=SynologyNVR:0|name=BeeStation:0" | awk '{print $2}' | uniq)"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user