Compare commits
32 Commits
21f481076c
...
main
Author | SHA1 | Date | |
---|---|---|---|
987ac44575 | |||
e8159fc8cb | |||
cc1463b166 | |||
14c72fe080 | |||
2922806e9c | |||
06e5111309 | |||
b04b9e9205 | |||
cad7792fa1 | |||
fd553b3442 | |||
9b849897e2 | |||
05f461f8c1 | |||
1cee89cd0a | |||
203138947b | |||
3d2e0e33af | |||
e11dc60438 | |||
7123fa1147 | |||
f1fd1aaff5 | |||
2dec392e50 | |||
6cb768a05e | |||
a0f8f49b27 | |||
09d63b6630 | |||
44ef429d5a | |||
de6d1d47c8 | |||
b335f61c72 | |||
c61686065e | |||
9a001021b1 | |||
6080fe48c1 | |||
36a18e870f | |||
40e14b5cc7 | |||
a96f533f8f | |||
b36c0b6939 | |||
7e68bbb891 |
@ -3,7 +3,7 @@
|
||||
> /tmp/docker_alarm.log
|
||||
docker ps -a --format "table {{.Names}}\t{{.Status}}" > /opt/logs/docker_status.log
|
||||
while read line; do
|
||||
echo $line | grep -q 'Exited'
|
||||
echo $line | grep -v 'v2raya' | grep -q 'Exited'
|
||||
if [[ $? -eq 0 ]]; then
|
||||
name=`echo $line | awk '{print $1}'`
|
||||
echo "Docker Alarm - $name: Container $name has been off line, please check ASAP." >> /tmp/docker_alarm.log
|
||||
@ -12,6 +12,6 @@ done < /opt/logs/docker_status.log
|
||||
|
||||
if [[ -s /tmp/docker_alarm.log ]]; then
|
||||
alarm=`cat /tmp/docker_alarm.log`
|
||||
python3 /opt/scripts/alert/sendmail.py "Docker Alarms" "$alarm"
|
||||
python3 /opt/git/scripts/alert/sendmail.py "Docker Alarms" "$alarm"
|
||||
fi
|
||||
|
||||
|
@ -8,8 +8,7 @@ cp -rf /var/spool/cron/crontabs/ /opt/configs/
|
||||
cp -rf /usr/local/nginx/conf/nginx.conf /opt/configs/nginx/nginx.conf
|
||||
cp -rf /usr/local/nginx/conf/domain_confs/ /opt/configs/nginx/
|
||||
cp -rf /etc/docker/daemon.json /opt/configs/conf/
|
||||
cp -rf /etc/sysctl.conf /opt/configs/conf/
|
||||
cp -rf /etc/sysctl.d/99-tailscale.conf /opt/configs/conf/
|
||||
cp -rf /etc/netdata/ /opt/configs/
|
||||
cp -rf /etc/pip.conf /opt/configs/conf/
|
||||
cp -rf /etc/apt/sources.list /opt/configs/conf/
|
||||
cp -rf /etc/ssh/sshd_config /opt/configs/conf/
|
||||
@ -21,10 +20,13 @@ cp -rf /etc/network/interfaces /opt/configs/conf/
|
||||
cp -rf /root/.acme.sh/*ecc /opt/configs/acme/
|
||||
cp -rf /root/.acme.sh/rustle.cc_ecc/rustle.cc.{key,cer} /opt/apps/syncthing/data/common/A_Program/nginx-1.24.0/certs/
|
||||
cp -rf /opt/apps/syncthing/data/common/A_Program/FRP/* /opt/apps/frp/frpc-xtcp-visitor/
|
||||
cp -rf /etc/systemd/network /opt/configs/conf/
|
||||
cp -rf /etc/modprobe.d/pcspkr-blacklist.conf /opt/configs/conf/
|
||||
cp -rf /lib/firmware/intel/ ibt-0040-1050* /opt/configs/conf/intel/
|
||||
|
||||
cd /opt && t=`date +%Y%m%dT%H%M%S`
|
||||
# rsync --delete-after -avz --exclude=apps/localcr/B_koel/local/music apps configs logs scripts websites wd/72-Backups/VPS/ > /opt/logs/rsync/rsync_${t}.log
|
||||
rsync --delete-after -avz apps configs logs scripts websites wd/72-Backups/VPS/ > /opt/logs/rsync/rsync_${t}.log
|
||||
rsync --delete-after -avz --exclude=apps/syncthing apps configs logs git websites wd/72-Backups/VPS/ > /opt/logs/rsync/rsync_${t}.log
|
||||
cd /opt/logs/rsync/
|
||||
let count=`ls | wc -l`
|
||||
if [[ $count -gt 10 ]]; then
|
||||
@ -43,9 +45,7 @@ if [[ `date +%d` == '01' ]]; then
|
||||
t=`date +%Y%m%d%H%M%S` && cd /opt/wd/72-Backups/
|
||||
|
||||
tar -I pigz -cf vps-${t}.tar.gz \
|
||||
--exclude=VPS/apps/localcr/B_koel/local/music \
|
||||
--exclude=VPS/apps/localcr/I_cloudreve/local/cloudreve/uploads \
|
||||
--exclude=VPS/apps/localcr/K_nextcloud/local/nextcloud/data/nextcloud/files \
|
||||
--exclude=VPS/apps/syncthing/data \
|
||||
VPS/ > /dev/null 2>&1
|
||||
# tar -I unpigz -xf vps-20231101162641.tar.gz
|
||||
|
@ -2,18 +2,18 @@
|
||||
|
||||
#==============================================================================
|
||||
/usr/bin/qbittorrent-nox --webui-port=10005 -d
|
||||
# /usr/bin/bash /opt/scripts/update/calibre.sh
|
||||
mv /opt/wd/99-Temp/shutdown /opt/wd/99-Temp/shutdown.old
|
||||
mv /opt/wd/99-Temp/reboot /opt/wd/99-Temp/reboot.old
|
||||
sleep 20
|
||||
ifconfig > /opt/wd/99-Temp/ifconfig.txt
|
||||
#==============================================================================
|
||||
# ip link set enp1s0 promisc on
|
||||
# ip link set enp2s0 promisc on
|
||||
# ip link set wlx90de80ca01ec promisc on
|
||||
#==============================================================================
|
||||
# sleep 20
|
||||
# /usr/bin/bash /opt/scripts/update/macvlan.sh
|
||||
# /usr/bin/bash /opt/git/scripts/update/macvlan.sh
|
||||
#==============================================================================
|
||||
# nohup /usr/bin/bash /opt/scripts/update/jekyll_update.sh > /dev/null 2>&1 &
|
||||
# /usr/bin/mount -t ext4 -w UUID="b7c2c4b8-bfde-479b-80bb-655432a433b8" /opt/wd
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# get latest hosts for accelerate github visiting
|
||||
curl https://raw.hellogithub.com/hosts >> /opt/logs/hosts
|
||||
# curl https://raw.hellogithub.com/hosts >> /opt/logs/hosts
|
||||
|
||||
# renew images.json file for background picture of homepage
|
||||
cd /opt/websites/homepage/
|
||||
@ -9,7 +9,7 @@ node assets/js/bing.js > /dev/null 2>&1
|
||||
|
||||
if [[ `date +%d` == '01' ]]; then
|
||||
# random logo for dash
|
||||
# bash /opt/scripts/update/dash_rand_logo.sh
|
||||
# bash /opt/git/scripts/update/dash_rand_logo.sh
|
||||
cp /root/.acme/rustle.cc_ecc/fullchain.cer '/opt/apps/syncthing/data/common/A_Program/nginx-1.24.0/certs/'
|
||||
cp /root/.acme/rustle.cc_ecc/rustle.cc.key '/opt/apps/syncthing/data/common/A_Program/nginx-1.24.0/certs/'
|
||||
fi
|
||||
@ -19,4 +19,4 @@ let numOfAvatar=`ls /opt/websites/homepage/assets/img/logos | wc -l`
|
||||
let randNumber=$RANDOM%$numOfAvatar
|
||||
cp /opt/websites/homepage/assets/img/logos/${randNumber}.jpg /opt/websites/homepage/assets/img/logo.jpg
|
||||
|
||||
docker exec -u www-data nextcloud php /var/www/html/occ files:scan --all
|
||||
# docker exec -u www-data nextcloud php /var/www/html/occ files:scan --all
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
rss=$(ps aux | grep frpc.toml | grep -v grep | awk '{print $6}')
|
||||
if [[ $rss == '' ]]; then
|
||||
python3 /opt/scripts/alert/bark/msgsend.py --title "FRPC Warning" --body "Seems like FRPC Service has been down, need to check ASAP." --group 'frp' --icon 8
|
||||
python3 /opt/git/scripts/alert/bark/msgsend.py --title "FRPC Warning" --body "Seems like FRPC Service has been down, need to check ASAP." --group 'frp' --icon 8
|
||||
exit 9
|
||||
fi
|
||||
|
||||
|
@ -24,7 +24,7 @@ def utool(option):
|
||||
# -a
|
||||
def list_local_using_port():
|
||||
exit_on_wrong_number()
|
||||
os.system('/usr/bin/bash /opt/scripts/utool/ipports.sh port')
|
||||
os.system('/usr/bin/bash /opt/git/scripts/utool/ipports.sh port')
|
||||
|
||||
# -b
|
||||
def github_two_factor():
|
||||
@ -34,7 +34,7 @@ def utool(option):
|
||||
# -c
|
||||
def get_external_ip():
|
||||
exit_on_wrong_number()
|
||||
os.system("/usr/bin/python3 /opt/scripts/roll_api/get_self_ip.py")
|
||||
os.system("/usr/bin/python3 /opt/git/scripts/roll_api/get_self_ip.py")
|
||||
|
||||
# -d
|
||||
def get_ip_location():
|
||||
@ -44,7 +44,7 @@ def utool(option):
|
||||
ipv4 = re.match(r"^((([01]?\d\d?)|(2[0-4]\d)|(25[0-5]))\.){3}(([01]?\d\d?)|(2[0-4]\d)|(25[0-5]))$", checked_ip)
|
||||
if ipv4:
|
||||
os.environ['checked_ip'] = checked_ip
|
||||
os.system('/usr/bin/python3 /opt/scripts/roll_api/get_ip.py $checked_ip')
|
||||
os.system('/usr/bin/python3 /opt/git/scripts/roll_api/get_ip.py $checked_ip')
|
||||
else:
|
||||
print(f"{c_br}Plz enter correct IP...{c_e}")
|
||||
exit(ord(option.strip('-')))
|
||||
@ -69,12 +69,12 @@ def utool(option):
|
||||
def number2date():
|
||||
exit_on_wrong_number(2)
|
||||
os.environ['param'] = sys.argv[2]
|
||||
os.system('/usr/bin/bash /opt/scripts/utool/number2d.sh $param')
|
||||
os.system('/usr/bin/bash /opt/git/scripts/utool/number2d.sh $param')
|
||||
|
||||
# -g
|
||||
def date2number():
|
||||
if len(sys.argv) < 3:
|
||||
print(f"{c_br}-k选项:将输入的时间转换成十进制和十六进制,需要一个字符串格式的时间作为输入,退出...{c_e}\n")
|
||||
print(f"{c_br}-g选项:将输入的时间转换成十进制和十六进制,需要一个字符串格式的时间作为输入,退出...{c_e}\n")
|
||||
exit(ord(option.strip('-')))
|
||||
|
||||
param=''
|
||||
@ -82,7 +82,7 @@ def utool(option):
|
||||
param += item + ' '
|
||||
|
||||
os.environ['param'] = param
|
||||
os.system('/usr/bin/bash /opt/scripts/utool/date2n.sh $param')
|
||||
os.system('/usr/bin/bash /opt/git/scripts/utool/date2n.sh $param')
|
||||
|
||||
# -h
|
||||
def usage():
|
||||
@ -92,19 +92,32 @@ def utool(option):
|
||||
# -i
|
||||
def ps_top_20():
|
||||
exit_on_wrong_number()
|
||||
os.system("/usr/bin/bash /opt/scripts/utool/ps_top_20.sh")
|
||||
os.system("/usr/bin/bash /opt/git/scripts/utool/ps_top_20.sh")
|
||||
|
||||
# -j
|
||||
def docker_pid():
|
||||
exit_on_wrong_number(2)
|
||||
os.environ['param'] = sys.argv[2]
|
||||
os.system('/usr/bin/bash /opt/scripts/utool/pid_in_docker.sh $param')
|
||||
os.system('/usr/bin/bash /opt/git/scripts/utool/pid_in_docker.sh $param')
|
||||
|
||||
# -k
|
||||
def company_two_factor():
|
||||
exit_on_wrong_number()
|
||||
# method 1
|
||||
# os.system("/usr/bin/echo -n 'ujjpsx7q'")
|
||||
# os.system("/usr/bin/oathtool -b --totp '22IH2VYKEQYOWVFCCHY5KTU4CYTJ7Z3O'")
|
||||
# method 2
|
||||
pin = 'ujjpsx7q'
|
||||
totp = os.popen("/usr/bin/oathtool -b --totp '22IH2VYKEQYOWVFCCHY5KTU4CYTJ7Z3O'").read()
|
||||
res = pin + totp
|
||||
print(res, end='')
|
||||
return res
|
||||
|
||||
# -p
|
||||
def gen_passwd():
|
||||
exit_on_wrong_number(2)
|
||||
os.environ['length'] = sys.argv[2]
|
||||
os.system('/usr/bin/bash /opt/scripts/utool/genpw.sh length')
|
||||
os.system('/usr/bin/bash /opt/git/scripts/utool/genpw.sh length')
|
||||
|
||||
def exit_on_wrong_number(number=1):
|
||||
if len(sys.argv) != (number+1):
|
||||
@ -134,7 +147,7 @@ def utool(option):
|
||||
'-v': ['Reserved', None],
|
||||
'-j': ['*find a docker subprocess, if true then print info', docker_pid],
|
||||
'-w': ['Reserved', None],
|
||||
'-k': ['Reserved', None],
|
||||
'-k': [' generate two-factor key of GITHUB', company_two_factor],
|
||||
'-x': ['Reserved', None],
|
||||
'-l': ['Reserved', None],
|
||||
'-y': ['Reserved', None],
|
||||
|
Reference in New Issue
Block a user