代码拉取完成,页面将自动刷新
同步操作将从 Lu Chang/UnraidProxyEditor 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。