增加template
This commit is contained in:
parent
18686957fd
commit
688cf86133
26
template/ReadMe.md
Normal file
26
template/ReadMe.md
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# template
|
||||||
|
|
||||||
|
## 概述
|
||||||
|
|
||||||
|
简要描述项目的功能
|
||||||
|
|
||||||
|
## 快速开始
|
||||||
|
|
||||||
|
### 一、配置环境
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3 -m venv env
|
||||||
|
source ./env/bin/activate
|
||||||
|
pip install -r requirements.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
### 二、运行程序
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python main.py
|
||||||
|
```
|
||||||
|
|
||||||
|
打印当前网络的节点信息,并在当前目录下产生文件`smartdns.conf`。
|
||||||
|
|
||||||
|
|
||||||
|
|
41
template/new.sh
Executable file
41
template/new.sh
Executable file
@ -0,0 +1,41 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#===========================================================================
|
||||||
|
# Organization : Individual Developer
|
||||||
|
# Filename : new.sh
|
||||||
|
# Author : Feng Bohan
|
||||||
|
# Create Time : 15:01:14 2024-12-10
|
||||||
|
# Last Modified: 15:07:34 2024-12-10
|
||||||
|
# Abstract :
|
||||||
|
#--------------------------------------------------------------------------
|
||||||
|
# Description:
|
||||||
|
#
|
||||||
|
#--------------------------------------------------------------------------
|
||||||
|
# Modification History:
|
||||||
|
#--------------------------------------------------------------------------
|
||||||
|
# Rev Date Who Description
|
||||||
|
# --- ---- --- -----------
|
||||||
|
# 0.0.01 2024-12-10 Feng Bohan initial version
|
||||||
|
#===========================================================================
|
||||||
|
|
||||||
|
currentYear=`date +%y`
|
||||||
|
currentMonth=`date +%m`
|
||||||
|
baseName="me${currentYear}${currentMonth}"
|
||||||
|
|
||||||
|
read -p "PLease enter ner project name: " prjName
|
||||||
|
|
||||||
|
counter=0
|
||||||
|
while IFS= read -r dirName; do
|
||||||
|
if [[ $dirName =~ ([0-9]{2})_ ]]; then
|
||||||
|
counter=${BASH_REMATCH[1]}
|
||||||
|
let counter+=1
|
||||||
|
else
|
||||||
|
counter=0
|
||||||
|
fi
|
||||||
|
new_name=$(printf "%s%02d_%s" $baseName $counter $prjName)
|
||||||
|
done < <(find . -maxdepth 1 -type d -name "${baseName}*" | sort)
|
||||||
|
|
||||||
|
echo "New project dir is $new_name"
|
||||||
|
if [ ! -d $new_name ]; then
|
||||||
|
mkdir $new_name
|
||||||
|
echo "Dir is not exists, try to mkdir."
|
||||||
|
fi
|
Loading…
x
Reference in New Issue
Block a user