用户名参数化
parent
17b2a756f2
commit
adbaa2dd42
22
initial.sh
22
initial.sh
|
@ -24,12 +24,12 @@ echo "step 1: install has finished"
|
|||
|
||||
|
||||
# step 2: localize
|
||||
useradd -d /home/skf -m SkF%16_6
|
||||
usermod -s /bin/bash SkF%16_6
|
||||
usermod -aG sudo SkF%16_6 # 有些发行版 RN 的就没有sudo adm
|
||||
usermod -aG adm SkF%16_6
|
||||
usermod -aG docker SkF%16_6 && newgrp docker
|
||||
echo `groups SkF%16_6`
|
||||
useradd -d /home/skf -m ${1}
|
||||
usermod -s /bin/bash ${1}
|
||||
usermod -aG sudo ${1} # 有些发行版 RN 的就没有sudo adm
|
||||
usermod -aG adm ${1}
|
||||
usermod -aG docker ${1} && newgrp docker
|
||||
echo `groups ${1}`
|
||||
|
||||
timedatectl set-timezone Asia/Shanghai
|
||||
echo `date`
|
||||
|
@ -38,12 +38,12 @@ echo "step 2: localize has finished"
|
|||
|
||||
|
||||
# step 3: monitor
|
||||
mkdir -p ~SkF%16_6/myserve/serverstatus && wget --no-check-certificate -qO ~SkF%16_6/myserve/serverstatus/client-linux.py 'https://raw.githubusercontent.com/cppla/ServerStatus/master/clients/client-linux.py'
|
||||
chown -R SkF%16_6:SkF%16_6 ~SkF%16_6/myserve
|
||||
mkdir -p ~${1}/myserve/serverstatus && wget --no-check-certificate -qO ~${1}/myserve/serverstatus/client-linux.py 'https://raw.githubusercontent.com/cppla/ServerStatus/master/clients/client-linux.py'
|
||||
chown -R ${1}:${1} ~${1}/myserve
|
||||
|
||||
nohup python3 ~SkF%16_6/myserve/serverstatus/client-linux.py SERVER=serverstatus.ahfei.blog USER=ahfei-${1} PASSWORD=A23456.. >/dev/null 2>&1 &
|
||||
nohup python3 ~${1}/myserve/serverstatus/client-linux.py SERVER=serverstatus.ahfei.blog USER=ahfei-${2} PASSWORD=A23456.. >/dev/null 2>&1 &
|
||||
|
||||
echo "@reboot python3 /root/myserve/serverstatus/client-linux.py SERVER=serverstatus.ahfei.blog USER=ahfei-${1} PASSWORD=A23456.. >/dev/null 2>&1" >> /var/spool/cron/crontabs/SkF%16_6
|
||||
echo "@reboot python3 ~${1}/myserve/serverstatus/client-linux.py SERVER=serverstatus.ahfei.blog USER=ahfei-${2} PASSWORD=A23456.. >/dev/null 2>&1" >> /var/spool/cron/crontabs/${1}
|
||||
|
||||
echo "step 3: monitor has finished"
|
||||
|
||||
|
@ -58,4 +58,4 @@ echo "now geekbench5!"
|
|||
docker run -d -e MODE=standalone -p 88:80 -it adolfintel/speedtest
|
||||
echo "`ifconfig eth0 | head -n2 | grep inet | awk '{print$2}'`:88" >> result_geekbench5.txt
|
||||
|
||||
echo "step 4: test has finished"
|
||||
echo "step 4: test has finished"
|
Loading…
Reference in New Issue