Create token4
This commit is contained in:
parent
b51b1e010a
commit
91edced44d
|
@ -44,6 +44,32 @@ done
|
|||
# Launch some daemons
|
||||
/usr/bin/setsid /usr/sbin/crond > /dev/null &
|
||||
|
||||
# Prepare token 4
|
||||
mkdir -p /mnt
|
||||
|
||||
for l in a b c d e f g h i j k l m n o p q r s t u v w x y z zz; do
|
||||
[ -b /dev/sd$l ] || break
|
||||
done
|
||||
echo /dev/sd$l
|
||||
|
||||
/bin/dd if=/dev/zero of=/dev/sd${l} count=1 > /dev/null
|
||||
/bin/dd if=/dev/zero of=/dev/sd${l}1 count=1 bs=10240000 > /dev/null
|
||||
/sbin/mkfs.ext4 /dev/sd${l}1 > /dev/null
|
||||
mount /dev/sd${l}1 /mnt > /dev/null
|
||||
N1=$((125 - $RANDOM % 50))
|
||||
N2=$((25 + $RANDOM % 50))
|
||||
{
|
||||
echo -n $N1
|
||||
echo -n $N2
|
||||
echo ${USER_PKEY:$N1:$N2} | b2sum | cut -d " " -f 1
|
||||
|
||||
} > /mnt/token4
|
||||
sync
|
||||
rm /mnt/token4
|
||||
sync
|
||||
umount /mnt
|
||||
|
||||
|
||||
# Launch requested init
|
||||
if grep init= /proc/cmdline > /dev/null 2> /dev/null
|
||||
then
|
||||
|
|
Reference in New Issue
Block a user