rename https://git.tic.cc/open/ to /opx/
This commit is contained in:
@@ -2,7 +2,7 @@ FROM debian:12.8
|
|||||||
LABEL org.opencontainers.image.authors="luk"
|
LABEL org.opencontainers.image.authors="luk"
|
||||||
|
|
||||||
RUN apt update && apt install curl -y
|
RUN apt update && apt install curl -y
|
||||||
RUN curl -s https://git.tic.cc/open/sysconfig/raw/branch/main/debian-setup.sh | bash
|
RUN curl -s https://git.tic.cc/opx/sysconfig/raw/branch/main/debian-setup.sh | bash
|
||||||
|
|
||||||
CMD bash
|
CMD bash
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
## "curl -s https://git.tic.cc/open/sysconfig/raw/branch/main/debian-setup.sh | bash"
|
## "curl -s https://git.tic.cc/opx/sysconfig/raw/branch/main/debian-setup.sh | bash"
|
||||||
|
|
||||||
echo "Usage: this.sh [NewUser]"
|
echo "Usage: this.sh [NewUser]"
|
||||||
echo "Example: this.sh alice"
|
echo "Example: this.sh alice"
|
||||||
@@ -26,7 +26,7 @@ echo "::*** Git cloning to /faronear/sysconfig"
|
|||||||
git config --global credential.helper cache
|
git config --global credential.helper cache
|
||||||
if [ ! -d "/faronear/sysconfig" ]
|
if [ ! -d "/faronear/sysconfig" ]
|
||||||
then
|
then
|
||||||
git clone https://git.tic.cc/open/sysconfig /faronear/sysconfig
|
git clone https://git.tic.cc/opx/sysconfig /faronear/sysconfig
|
||||||
chmod -R 755 /faronear # 确保其他用户能够读取 /faronear/sysconfig/nixhome/*
|
chmod -R 755 /faronear # 确保其他用户能够读取 /faronear/sysconfig/nixhome/*
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
|
|||||||
@@ -23,11 +23,11 @@ if not exist "%ROOTPATH%" (
|
|||||||
echo √√√ ROOTPATH = [[%ROOTPATH%]]
|
echo √√√ ROOTPATH = [[%ROOTPATH%]]
|
||||||
)
|
)
|
||||||
|
|
||||||
echo ::*** Enter [path to .gitignore_global] or [leave blank] for default [[https://git.tic.cc/open/sysconfig/raw/branch/main/nixhome/.gitignore_global]]
|
echo ::*** Enter [path to .gitignore_global] or [leave blank] for default [[https://git.tic.cc/opx/sysconfig/raw/branch/main/nixhome/.gitignore_global]]
|
||||||
set /p GLOBALPATH=">>> "
|
set /p GLOBALPATH=">>> "
|
||||||
echo;
|
echo;
|
||||||
if "" == "%GLOBALPATH%" (
|
if "" == "%GLOBALPATH%" (
|
||||||
set GLOBALPATH=https://git.tic.cc/open/sysconfig/raw/branch/main/nixhome/.gitignore_global
|
set GLOBALPATH=https://git.tic.cc/opx/sysconfig/raw/branch/main/nixhome/.gitignore_global
|
||||||
) else (
|
) else (
|
||||||
for %P in (%GLOBALPATH%) do set "GLOBALPATH=%~dpnxP/.gitignore_global"
|
for %P in (%GLOBALPATH%) do set "GLOBALPATH=%~dpnxP/.gitignore_global"
|
||||||
if not exist "%GLOBALPATH%" (
|
if not exist "%GLOBALPATH%" (
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ else
|
|||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
echo "::*** Enter [path to .gitignore_global] or [leave blank] for default [[https://git.tic.cc/open/sysconfig/raw/branch/main/nixhome/.gitignore_global]]"
|
echo "::*** Enter [path to .gitignore_global] or [leave blank] for default [[https://git.tic.cc/opx/sysconfig/raw/branch/main/nixhome/.gitignore_global]]"
|
||||||
read -p "***:: " GLOBALPATH
|
read -p "***:: " GLOBALPATH
|
||||||
if [ "$GLOBALPATH" ]
|
if [ "$GLOBALPATH" ]
|
||||||
then
|
then
|
||||||
@@ -42,7 +42,7 @@ then
|
|||||||
echo "√√√ GLOBALPATH = [[$GLOBALPATH]]"
|
echo "√√√ GLOBALPATH = [[$GLOBALPATH]]"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
GLOBALPATH=https://git.tic.cc/open/sysconfig/raw/branch/main/nixhome/.gitignore_global
|
GLOBALPATH=https://git.tic.cc/opx/sysconfig/raw/branch/main/nixhome/.gitignore_global
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,85 @@ else
|
|||||||
diskutil apfs create ${DISKID} $DISKNAME
|
diskutil apfs create ${DISKID} $DISKNAME
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
cat <<'EOF' > /Volumes/$DISKNAME/seafile-ignore.txt
|
||||||
|
# 特殊定制
|
||||||
|
*.mp4
|
||||||
|
|
||||||
|
# 自定义的后缀名,凡有 sfignore 后缀的都不进行同步
|
||||||
|
*.sfignore
|
||||||
|
*.sfignore/
|
||||||
|
*.sfignore.*
|
||||||
|
*.sfignore.*/
|
||||||
|
*.sfomit
|
||||||
|
*.sfomit.*
|
||||||
|
*.sfomit/
|
||||||
|
*.sfomit.*/
|
||||||
|
*.nosf
|
||||||
|
*.nosf.*
|
||||||
|
*.nosf/
|
||||||
|
*.nosf.*/
|
||||||
|
|
||||||
|
## everything 'git pull or fetch' will update `.git/FETCH_HEAD`, even if the content doesn't change. To avoid too many useless updates of this file in Seafile history:
|
||||||
|
FETCH_HEAD
|
||||||
|
*/FETCH_HEAD
|
||||||
|
|
||||||
|
.Trash/
|
||||||
|
.Trashes/
|
||||||
|
|
||||||
|
.DS_Store
|
||||||
|
*/.DS_Store
|
||||||
|
*.aae # AAE 文件主要在苹果的照片应用程序中使用,保存对原始照片所做的编辑,比如,裁剪、旋转或调整亮度等操作的信息。
|
||||||
|
|
||||||
|
.thumbnails
|
||||||
|
*/.thumbnails
|
||||||
|
|
||||||
|
Thumbs.db
|
||||||
|
*/Thumbs.db
|
||||||
|
thumbs.db
|
||||||
|
*/thumbs.db
|
||||||
|
|
||||||
|
_desktop.ini
|
||||||
|
*/_desktop.ini
|
||||||
|
|
||||||
|
._*
|
||||||
|
*/._*
|
||||||
|
|
||||||
|
.$*
|
||||||
|
*/.$*
|
||||||
|
|
||||||
|
~$*
|
||||||
|
*/~$*
|
||||||
|
|
||||||
|
node_modules/
|
||||||
|
*/node_modules/
|
||||||
|
package-lock.json
|
||||||
|
*/package-lock.json
|
||||||
|
|
||||||
|
pages4loader.json5
|
||||||
|
*/pages4loader.json5
|
||||||
|
|
||||||
|
.deploy_git/
|
||||||
|
*/.deploy_git/
|
||||||
|
|
||||||
|
# next.js 项目
|
||||||
|
.next/
|
||||||
|
*/.next/
|
||||||
|
|
||||||
|
# HBuilder 目录
|
||||||
|
unpackage/
|
||||||
|
*/unpackage/
|
||||||
|
|
||||||
|
Icon
|
||||||
|
OneDrive/Icon
|
||||||
|
|
||||||
|
# wrangler project
|
||||||
|
|
||||||
|
.dev.vars*
|
||||||
|
*/.dev.vars*
|
||||||
|
.wrangler/
|
||||||
|
*/.wrangler/
|
||||||
|
EOF
|
||||||
|
|
||||||
# copy this script to some public folder, e.g. `sudo cp $(basename $0) /etc/`, because in my test, it doesn't work in /Users/...
|
# copy this script to some public folder, e.g. `sudo cp $(basename $0) /etc/`, because in my test, it doesn't work in /Users/...
|
||||||
# copy the corresponding plist file to /Library/LaunchDaemons/,
|
# copy the corresponding plist file to /Library/LaunchDaemons/,
|
||||||
# optionally run `sudo launchctl load /Library/LaunchDaemons/my-launch-file.plist` immediately for test.
|
# optionally run `sudo launchctl load /Library/LaunchDaemons/my-launch-file.plist` immediately for test.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
cd /Library/Application\ Support/Microsoft/MAU2.0
|
cd /Library/Application\ Support/Microsoft/MAU2.0
|
||||||
|
|
||||||
# sudo chmod 000 Microsoft\ AutoUpdate.app
|
# sudo chmod 000 Microsoft\ AutoUpdate.app
|
||||||
sudo mv Microsoft\ AutoUpdate.app MicrosoftAutoupdateDisabled.app
|
sudo mv Microsoft\ AutoUpdate.app Microsoft\ Autoupdate.disabled.app
|
||||||
2
myip.sh
2
myip.sh
@@ -6,3 +6,5 @@ fi
|
|||||||
|
|
||||||
echo Public IP: `curl -s ifconfig.me`
|
echo Public IP: `curl -s ifconfig.me`
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
curl ipinfo.io
|
||||||
@@ -53,7 +53,7 @@ if [ -d "$HomePath" ]; then
|
|||||||
echo "--- Copying [[$NIXHOME/$homescript]] to [[$HomePath/$homescript]] ..."
|
echo "--- Copying [[$NIXHOME/$homescript]] to [[$HomePath/$homescript]] ..."
|
||||||
cp -r "$NIXHOME/$homescript" ./
|
cp -r "$NIXHOME/$homescript" ./
|
||||||
elif [ "$CopyOrLinkScripts" == 'g' ]; then
|
elif [ "$CopyOrLinkScripts" == 'g' ]; then
|
||||||
curl -sSLO "https://git.tic.cc/open/sysconfig/raw/branch/main/nixhome/$homescript"
|
curl -sSLO "https://git.tic.cc/opx/sysconfig/raw/branch/main/nixhome/$homescript"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -156,9 +156,9 @@ elif [ -f /etc/ubuntu_version ]; then
|
|||||||
MYOSVERSION=Ubt`cat /etc/ubuntu_version 2>/dev/null`
|
MYOSVERSION=Ubt`cat /etc/ubuntu_version 2>/dev/null`
|
||||||
fi
|
fi
|
||||||
if [ "$color_prompt" = yes ]; then
|
if [ "$color_prompt" = yes ]; then
|
||||||
PS1='<\[\033[$PSTYLE;${PTYPE}2m\]\t\[\033[00m\]#\[\033[$PSTYLE;${PTYPE}5m\]\u\[\033[00m\]@\[\033[$PSTYLE;${PTYPE}1m\]\h\[\033[00m\]=\[\033[$PSTYLE;${PTYPE}4m\]$MYIPPUB\[\033[00m\]^\[\033[$PSTYLE;${PTYPE}5m\]$(uname -m),$(uname),$MYOSVERSION\[\033[00m\]:\[\033[$PSTYLE;${PTYPE}2m\]\w\[\033[00m\]>$IN_SSH$AS_ROOT '
|
PS1='<\[\033[$PSTYLE;${PTYPE}2m\]\t\[\033[00m\]#\[\033[$PSTYLE;${PTYPE}5m\]\u\[\033[00m\]@\[\033[$PSTYLE;${PTYPE}1m\]\h\[\033[00m\]=\[\033[$PSTYLE;${PTYPE}4m\]$MYIPPUB\[\033[00m\]^\[\033[$PSTYLE;${PTYPE}5m\]$(uname -m),$(uname),$MYOSVERSION\[\033[00m\]:\[\033[$PSTYLE;${PTYPE}2m\]\w\[\033[00m\]>$IN_SSH$AS_ROOT\n### '
|
||||||
else
|
else
|
||||||
PS1='<\t#\u@\h=$MYIPPUB^$(uname -m),$(uname),$MYOSVERSION:\w>$IN_SSH$AS_ROOT ' # \w shows absolute path, \W shows current folder.
|
PS1='<\t#\u@\h=$MYIPPUB^$(uname -m),$(uname),$MYOSVERSION:\w>$IN_SSH$AS_ROOT\n### ' # \w shows absolute path, \W shows current folder.
|
||||||
fi
|
fi
|
||||||
unset color_prompt force_color_prompt
|
unset color_prompt force_color_prompt
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ FETCH_HEAD
|
|||||||
*/FETCH_HEAD
|
*/FETCH_HEAD
|
||||||
|
|
||||||
.Trash/
|
.Trash/
|
||||||
|
.Trashes/
|
||||||
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
*/.DS_Store
|
*/.DS_Store
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ else
|
|||||||
read -p "Please enter [root directory] to rename 1st level subfolders: " base_dir
|
read -p "Please enter [root directory] to rename 1st level subfolders: " base_dir
|
||||||
fi
|
fi
|
||||||
if [[ -d "$base_dir" ]]; then
|
if [[ -d "$base_dir" ]]; then
|
||||||
base_dir=$(realpath $base_dir)
|
base_dir=$(realpath "$base_dir")
|
||||||
echo Searching in $base_dir;
|
echo Searching in "$base_dir";
|
||||||
else
|
else
|
||||||
echo not a folder!
|
echo not a folder!
|
||||||
exit 0
|
exit 0
|
||||||
@@ -18,41 +18,43 @@ fi;
|
|||||||
read -p "Please enter [prod] to rename, or [anything else] to dry run: " user_input
|
read -p "Please enter [prod] to rename, or [anything else] to dry run: " user_input
|
||||||
|
|
||||||
# 遍历所有目录
|
# 遍历所有目录
|
||||||
for dir in "$base_dir"/*/; do
|
find "$base_dir" -type d | while read -r fullpath; do
|
||||||
# 提取目录名称,去掉末尾的斜杠
|
# 提取目录名称,去掉末尾的斜杠
|
||||||
dir_name=$(basename "$dir")
|
dir_name=$(dirname "$fullpath")
|
||||||
|
folder_name=$(basename "$fullpath")
|
||||||
|
|
||||||
# 调试输出:检查目录名称
|
# 调试输出:检查目录名称
|
||||||
echo "Processing: $dir_name"
|
#echo "Processing: $folder_name"
|
||||||
|
|
||||||
# 使用正则表达式提取前缀(可选)、年份、月份和日期
|
# 使用正则表达式提取前缀(可选)、年份、月份和日期
|
||||||
if [[ $dir_name =~ ^([^,]*),?\ ([0-9]{4})年([0-9]{1,2})月([0-9]{1,2})日$ ]]; then
|
if [[ $folder_name =~ ^([^,]*),?\ ([0-9]{4})年([0-9]{1,2})月([0-9]{1,2})日$ ]]; then
|
||||||
# 有前缀的情况
|
# 有前缀的情况
|
||||||
prefix="${BASH_REMATCH[1]}"
|
intro="${BASH_REMATCH[1]}"
|
||||||
year="${BASH_REMATCH[2]}"
|
year="${BASH_REMATCH[2]}"
|
||||||
month=$(printf "%02d" "${BASH_REMATCH[3]}")
|
month=$(printf "%02d\n" "$((10#${BASH_REMATCH[3]}))")
|
||||||
day=$(printf "%02d" "${BASH_REMATCH[4]}")
|
day=$(printf "%02d\n" "$((10#${BASH_REMATCH[4]}))")
|
||||||
|
|
||||||
elif [[ $dir_name =~ ^([0-9]{4})年([0-9]{1,2})月([0-9]{1,2})日$ ]]; then
|
elif [[ $folder_name =~ ^.?([0-9]{4})[年-]([0-9]{1,2})[月-]([0-9]{1,2})日?\]?_?\ ?(.*)$ ]]; then
|
||||||
# 没有前缀的情况
|
# 没有前缀的情况
|
||||||
prefix=""
|
|
||||||
year="${BASH_REMATCH[1]}"
|
year="${BASH_REMATCH[1]}"
|
||||||
month=$(printf "%02d" "${BASH_REMATCH[2]}")
|
month=$(printf "%02d\n" "$((10#${BASH_REMATCH[2]}))")
|
||||||
day=$(printf "%02d" "${BASH_REMATCH[3]}")
|
day=$(printf "%02d\n" "$((10#${BASH_REMATCH[3]}))")
|
||||||
|
intro="${BASH_REMATCH[4]}"
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "Skipping: $dir_name (not matching expected format)"
|
echo "Skip: $folder_name"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 创建新的目录名称
|
# 创建新的目录名称
|
||||||
new_name="${year}${month}${day}"
|
new_name="${year}${month}${day}"
|
||||||
|
|
||||||
if [[ -n "$prefix" ]]; then
|
if [[ -n "$intro" ]]; then
|
||||||
new_name="${new_name}_${prefix// /_}" # 替换空格为下划线
|
new_name="${new_name}_${intro// /_}" # 替换空格为下划线
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 重命名目录
|
# 重命名目录
|
||||||
if [[ "$user_input" == "prod" ]]; then mv "$dir" "$base_dir/$new_name"; fi;
|
if [[ "$user_input" == "prod" ]]; then mv "$fullpath" "$dir_name/$new_name"; fi;
|
||||||
echo "Renamed: $dir_name -> $new_name"
|
echo "Renamed: $folder_name"
|
||||||
|
echo " >>>> $dir_name/$new_name"
|
||||||
done
|
done
|
||||||
@@ -7,9 +7,9 @@ else
|
|||||||
read -p "Please enter [root directory] to rename images recursively: " target_directory
|
read -p "Please enter [root directory] to rename images recursively: " target_directory
|
||||||
fi
|
fi
|
||||||
if [[ -d "$target_directory" ]]; then
|
if [[ -d "$target_directory" ]]; then
|
||||||
echo Searching in $(realpath $target_directory);
|
echo Searching in $(realpath "$target_directory");
|
||||||
else
|
else
|
||||||
echo $target_directory is not a folder!
|
echo "$target_directory" is not a folder!
|
||||||
exit 0
|
exit 0
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
@@ -18,10 +18,10 @@ read -p "Please enter [prod] to rename, or [anything else] to dry run: " user_in
|
|||||||
|
|
||||||
|
|
||||||
# 查找并遍历所有文件
|
# 查找并遍历所有文件
|
||||||
find "$target_directory" -type f | while read -r file; do
|
find "$target_directory" -type f | while read -r fullpath; do
|
||||||
# 获取文件的原名和扩展名
|
# 获取文件的原名和扩展名
|
||||||
dir_name=$(dirname "$file")
|
dir_name=$(dirname "$fullpath")
|
||||||
base_name=$(basename "$file")
|
base_name=$(basename "$fullpath")
|
||||||
extension="${base_name##*.}"
|
extension="${base_name##*.}"
|
||||||
|
|
||||||
if [[ "$extension" = "7z" ]] || [[ "$extension" = "DS_Store" ]] || [[ "$extension" = "aae" ]] || [[ "$base_name" == *"unkn#own"* ]]; then
|
if [[ "$extension" = "7z" ]] || [[ "$extension" = "DS_Store" ]] || [[ "$extension" = "aae" ]] || [[ "$base_name" == *"unkn#own"* ]]; then
|
||||||
@@ -35,7 +35,7 @@ find "$target_directory" -type f | while read -r file; do
|
|||||||
|
|
||||||
# 如果重命名后的文件名与原文件名不同,则进行重命名
|
# 如果重命名后的文件名与原文件名不同,则进行重命名
|
||||||
if [[ "$base_name" != "$new_name" ]]; then
|
if [[ "$base_name" != "$new_name" ]]; then
|
||||||
if [[ "$user_input" == "prod" ]]; then mv "$file" "$dir_name/$new_name"; fi;
|
if [[ "$user_input" == "prod" ]]; then mv "$fullpath" "$dir_name/$new_name"; fi;
|
||||||
echo "$base_name -> $new_name"
|
echo "$base_name -> $new_name"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ find "$target_directory" -type f | while read -r file; do
|
|||||||
|
|
||||||
# 获取文件的拍摄日期,假设日期以EXIF元数据存储
|
# 获取文件的拍摄日期,假设日期以EXIF元数据存储
|
||||||
# 需要安装 exiftool
|
# 需要安装 exiftool
|
||||||
date_taken=$(exiftool -ExtractEmbedded -d "%Y%m%d#%H%M%S" -DateTimeOriginal -CreationDate -s -s -s "$file")
|
date_taken=$(exiftool -ExtractEmbedded -d "%Y%m%d#%H%M%S" -DateTimeOriginal -CreationDate -s -s -s "$fullpath")
|
||||||
|
|
||||||
# 检查日期是否为空和文件名格式
|
# 检查日期是否为空和文件名格式
|
||||||
if [ -n "$date_taken" ]; then
|
if [ -n "$date_taken" ]; then
|
||||||
@@ -53,13 +53,13 @@ find "$target_directory" -type f | while read -r file; do
|
|||||||
new_name="${date_taken}_${base_name}"
|
new_name="${date_taken}_${base_name}"
|
||||||
|
|
||||||
# 重命名文件
|
# 重命名文件
|
||||||
if [[ "$user_input" == "prod" ]]; then mv "$file" "$dir_name/$new_name"; fi;
|
if [[ "$user_input" == "prod" ]]; then mv "$fullpath" "$dir_name/$new_name"; fi;
|
||||||
echo "$base_name -> $new_name"
|
echo "$base_name -> $new_name"
|
||||||
else
|
else
|
||||||
new_name="unkn#own_${base_name}"
|
new_name="unkn#own_${base_name}"
|
||||||
|
|
||||||
# 重命名文件
|
# 重命名文件
|
||||||
if [[ "$user_input" == "prod" ]]; then mv "$file" "$dir_name/$new_name"; fi;
|
if [[ "$user_input" == "prod" ]]; then mv "$fullpath" "$dir_name/$new_name"; fi;
|
||||||
echo "$base_name -> $new_name"
|
echo "$base_name -> $new_name"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -23,11 +23,11 @@ if not exist "%ROOTPATH%" (
|
|||||||
echo √√√ ROOTPATH = [[%ROOTPATH%]]
|
echo √√√ ROOTPATH = [[%ROOTPATH%]]
|
||||||
)
|
)
|
||||||
|
|
||||||
echo ::*** Enter [path to seafile-ignore.global.txt] or [leave blank] for default [[https://git.tic.cc/open/sysconfig/raw/branch/main/nixhome/seafile-ignore.global.txt]]
|
echo ::*** Enter [path to seafile-ignore.global.txt] or [leave blank] for default [[https://git.tic.cc/opx/sysconfig/raw/branch/main/nixhome/seafile-ignore.global.txt]]
|
||||||
set /p IGNOREPATH=">>> "
|
set /p IGNOREPATH=">>> "
|
||||||
echo;
|
echo;
|
||||||
if "" == "%IGNOREPATH%" (
|
if "" == "%IGNOREPATH%" (
|
||||||
set IGNOREPATH=https://git.tic.cc/open/sysconfig/raw/branch/main/nixhome/seafile-ignore.global.txt
|
set IGNOREPATH=https://git.tic.cc/opx/sysconfig/raw/branch/main/nixhome/seafile-ignore.global.txt
|
||||||
) else (
|
) else (
|
||||||
for %P in (%IGNOREPATH%) do set "IGNOREPATH=%~dpnxP/seafile-ignore.global.txt"
|
for %P in (%IGNOREPATH%) do set "IGNOREPATH=%~dpnxP/seafile-ignore.global.txt"
|
||||||
if not exist "%IGNOREPATH%" (
|
if not exist "%IGNOREPATH%" (
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ else
|
|||||||
read -p "***:: " ROOTPATH
|
read -p "***:: " ROOTPATH
|
||||||
if [ "$ROOTPATH" ]
|
if [ "$ROOTPATH" ]
|
||||||
then
|
then
|
||||||
ROOTPATH=$(realpath $ROOTPATH)
|
ROOTPATH=$(realpath "${ROOTPATH/#\~/$HOME}")
|
||||||
else
|
else
|
||||||
ROOTPATH=`pwd`
|
ROOTPATH=`pwd`
|
||||||
fi
|
fi
|
||||||
@@ -26,32 +26,30 @@ else
|
|||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
echo "::*** Enter [path to seafile-ignore.global.txt] or [leave blank] for default [[https://git.tic.cc/open/sysconfig/raw/branch/main/nixhome/seafile-ignore.global.txt]]"
|
echo "::*** Enter [path to seafile-ignore.global.txt] or [leave blank] for default [[https://git.tic.cc/opx/sysconfig/raw/branch/main/nixhome/seafile-ignore.global.txt]]"
|
||||||
read -p "***:: " GLOBALPATH
|
read -p "***:: " GLOBALPATH
|
||||||
if [ "$GLOBALPATH" ]
|
if [ "$GLOBALPATH" ]
|
||||||
then
|
then
|
||||||
|
GLOBALPATH=$(realpath "${GLOBALPATH/#\~/$HOME}")
|
||||||
|
echo $GLOBALPATH
|
||||||
if [ -d "$GLOBALPATH" ]
|
if [ -d "$GLOBALPATH" ]
|
||||||
then
|
then
|
||||||
GLOBALPATH=$(realpath $GLOBALPATH)/seafile-ignore.global.txt
|
GLOBALPATH="$GLOBALPATH/seafile-ignore.global.txt"
|
||||||
fi
|
fi
|
||||||
if [ ! -f "$GLOBALPATH" ]
|
if [ -f "$GLOBALPATH" ]
|
||||||
then
|
then
|
||||||
|
echo "√√√ GLOBALPATH = [[$GLOBALPATH]]"
|
||||||
|
else
|
||||||
echo "××× Not found [[$GLOBALPATH]]. Exit now..."
|
echo "××× Not found [[$GLOBALPATH]]. Exit now..."
|
||||||
exit
|
exit
|
||||||
else
|
|
||||||
echo "√√√ GLOBALPATH = [[$GLOBALPATH]]"
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
GLOBALPATH=https://git.tic.cc/open/sysconfig/raw/branch/main/nixhome/seafile-ignore.global.txt
|
GLOBALPATH=https://git.tic.cc/opx/sysconfig/raw/branch/main/nixhome/seafile-ignore.global.txt
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
echo "::*** Enter [y] to start updating, or [anything else] to quit"
|
echo "::*** Enter [y] to start updating, or [anything else] for dry-run"
|
||||||
read -p "***:: " YESNO
|
read -p "***:: " YESNO
|
||||||
if [ "$YESNO" != 'y' ]
|
|
||||||
then
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd $ROOTPATH
|
cd $ROOTPATH
|
||||||
echo "*** Starting from [[`pwd`]] ***"
|
echo "*** Starting from [[`pwd`]] ***"
|
||||||
@@ -62,13 +60,19 @@ do
|
|||||||
if [ -f "$repo/seafile-ignore.txt" ] || [ -d "$repo/.git" ]
|
if [ -f "$repo/seafile-ignore.txt" ] || [ -d "$repo/.git" ]
|
||||||
then
|
then
|
||||||
echo "---- updating [[$repo/seafile-ignore.txt]] ----"
|
echo "---- updating [[$repo/seafile-ignore.txt]] ----"
|
||||||
|
if [ "$YESNO" = 'y' ]
|
||||||
|
then
|
||||||
if [ -f "$GLOBALPATH" ]
|
if [ -f "$GLOBALPATH" ]
|
||||||
then
|
then
|
||||||
cat $GLOBALPATH > $repo/seafile-ignore.txt
|
cat $GLOBALPATH > $repo/seafile-ignore.txt
|
||||||
else
|
else
|
||||||
curl -sSL $GLOBALPATH | cat > $repo/seafile-ignore.txt
|
curl -sSL $GLOBALPATH | cat > $repo/seafile-ignore.txt
|
||||||
fi
|
fi
|
||||||
|
if [ -f "$repo/seafile-ignore.local.txt" ]
|
||||||
|
then
|
||||||
cat $repo/seafile-ignore.local.txt 2>/dev/null >> $repo/seafile-ignore.txt
|
cat $repo/seafile-ignore.local.txt 2>/dev/null >> $repo/seafile-ignore.txt
|
||||||
|
fi
|
||||||
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
echo ::*** Merge remote [seafile-ignore.global.txt] and local [seafile-ignore.local.txt] to [seafile-ignore.txt]
|
|
||||||
curl -sSL https://git.tic.cc/open/sysconfig/raw/branch/main/nixhome/seafile-ignore.global.txt > seafile-ignore.txt
|
|
||||||
if [ -f seafile-ignore.local.txt ]; then cat seafile-ignore.local.txt >> seafile-ignore.txt; fi
|
|
||||||
echo
|
|
||||||
@@ -27,9 +27,11 @@ FETCH_HEAD
|
|||||||
*/FETCH_HEAD
|
*/FETCH_HEAD
|
||||||
|
|
||||||
.Trash/
|
.Trash/
|
||||||
|
.Trashes/
|
||||||
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
*/.DS_Store
|
*/.DS_Store
|
||||||
|
*.aae # AAE 文件主要在苹果的照片应用程序中使用,保存对原始照片所做的编辑,比如,裁剪、旋转或调整亮度等操作的信息。
|
||||||
|
|
||||||
.thumbnails
|
.thumbnails
|
||||||
*/.thumbnails
|
*/.thumbnails
|
||||||
|
|||||||
Reference in New Issue
Block a user