diff options
author | garhve <git@garhve.com> | 2023-02-07 09:24:38 +0800 |
---|---|---|
committer | garhve <git@garhve.com> | 2023-02-07 09:24:38 +0800 |
commit | d000e5e10923cab2c044cdc5b593f05b6c694012 (patch) | |
tree | 1fff99219e07ab2824da48f5d5bbf68b3fc8ceb4 | |
parent | 1d329a455ba14d2dd9951d7b1284f0e7b8feabf6 (diff) |
-rwxr-xr-x | bash/blog-zola.sh | 15 | ||||
-rwxr-xr-x | bash/update_bt.sh | 4 |
2 files changed, 15 insertions, 4 deletions
diff --git a/bash/blog-zola.sh b/bash/blog-zola.sh index 90f3050..c620789 100755 --- a/bash/blog-zola.sh +++ b/bash/blog-zola.sh @@ -55,7 +55,19 @@ new() { # get basic format d="$(date +%F)" + echo -ne "\x1b[32m" + echo -n "existing categories: " + grep -wrn content -e "categories" | \ + awk -F = '{ print $2 }' | \ + sort | uniq | paste -s -d ' ' + echo -ne "\x1b[0m" read -r -p "category: " category + echo -ne "\x1b[32m" + echo -n "existing tags: " + grep -wrn content -e "tags" | \ + awk -F = '{ print $2 }' | \ + sort | uniq | paste -s -d ' ' + echo -ne "\x1b[0m" read -r -p "tag: " tags read -r -p "math support [y/n]: " m if [ "${m,,}" == 'y' ]; then @@ -76,7 +88,6 @@ math = $math_support +++ EOF - vim "$path".md [ "$?" -eq 0 ] && echo "creation done" [ "$?" -ne 0 ] && echo "creation fail, please check error" && exit 1 @@ -85,7 +96,7 @@ EOF fi read -r -p "do you want to edit now?[y/n] " ans - [ "${ans,,}" == 'y' ] && vim "$path/$name.md" && echo "edit done" + [ "${ans,,}" == 'y' ] && vim "$path.md" && echo "edit done" push diff --git a/bash/update_bt.sh b/bash/update_bt.sh index 5023308..6213d87 100755 --- a/bash/update_bt.sh +++ b/bash/update_bt.sh @@ -1,6 +1,6 @@ #! /bin/sh -site=https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt +site="https://cdn.jsdelivr.net/gh/ngosang/trackerslist@master/trackers_all.txt" file=/home/pi/aria2-config/aria2.conf @@ -10,4 +10,4 @@ current="bt-tracker=$(curl $site | tr -s '[:space:]' | tr '[:space:]' ',')" #sshpass -p 'cctv7701' ssh -T $Addr "sed -i 's|$(grep -A 1 bt-trackers $file)|'\"${current}\"'|' $file" -$(sshpass -p 'cctv7701' ssh -T $Addr "sed -i '410d' $file | echo $current >> $file") +$(sshpass -p 'Ilikeapplepi' ssh -T $Addr "sed -i '410d' $file | echo $current >> $file") |