1 Star 0 Fork 0

妖鬼铭/unraid-proxy-editor

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
build_pkg.sh 1.50 KB
一键复制 编辑 原始数据 按行查看 历史
Lu Chang 提交于 2022-12-22 16:05 . pkg: 2022.12.22e
#!/bin/sh
# Given a version name and source code directory, create the snmp-unraid package
# Example: bash /boot/createpackage.sh 1337-01-01b /boot/pluginSource/
# https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
set -euo pipefail
package_name="proxy.editor"
echo "Version defined as [$1]"
echo "Source code directory defined as [$2]"
# Check that makepkg is available.
# Redirect STDOUT to /dev/null so if it is available, it doesn't print
# https://stackoverflow.com/questions/26675681/how-to-check-the-exit-status-using-an-if-statement
if command -v makepkg > /dev/null; then
# Assemble the output package file name using the directory we started in
file_name=$(printf "%s/%s-%s.txz" "$(pwd)" "$package_name" "$1")
# Move to directory containing files and folders going into the package
cd "$2"
echo "Changing CRLF to LF..."
find . -name "*.sh" -o -name "*.page" -o -name "*.md" -o -name "*.php" -o -name "*.txt" | xargs sed -i "s/\r$//"
echo "Setting permission..."
find . -type d -print0 | xargs -0 chmod 755
find . -type f -print0 | xargs -0 chmod 644
find . -type f -iname "*.sh" -print0 | xargs -0 chmod a+x
echo "Cleaning up .DS_Store files in source code directory first..."
find . -name '.DS_Store' -type f -delete
echo "Creating Slackware package $file_name"
makepkg -l y -c n "$file_name"
echo "MD5 of $file_name is $(md5sum $file_name | awk '{print $1}')"
else
echo "Binary makepkg not found, is your OS Slackware?"
fi
exit 0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yuanxiaozha/github-unraid-proxy-editor.git
git@gitee.com:yuanxiaozha/github-unraid-proxy-editor.git
yuanxiaozha
github-unraid-proxy-editor
unraid-proxy-editor
master

搜索帮助