This commit is contained in:
hl committed 2026-07-23 18:56:11 +08:00
1 parent 45414656f6
commit 91addc3cee
1 file changed
+12 -6
+12 -6
View File
@@ -95,13 +95,13 @@ main(){
rm -rf "$tmp_dir"
exit 0
else
echo "Not Debian System"
echo "ERROR: Not Debian System"
popd >/dev/null
rm -rf "$tmp_dir"
exit 1
fi
else
echo "Unknown format: $pkgname"
echo "ERROR: Unknown Format $pkgname"
popd >/dev/null
rm -rf "$tmp_dir"
exit 1
@@ -126,7 +126,7 @@ main(){
fi
cd "$current_dir"
else
echo "Wrong dir inside package!"
echo "ERROR: Wrong dir inside package!"
popd >/dev/null
rm -rf "$tmp_dir"
exit 1
@@ -147,7 +147,7 @@ main(){
fi
cd "$current_dir"
else
echo "Wrong dir inside package!"
echo "ERROR: Wrong dir inside package!"
popd >/dev/null
rm -rf "$tmp_dir"
exit 1
@@ -157,7 +157,7 @@ main(){
fi
CWD=$(pwd)
if [ ${CWD:0:5} != "/tmp/" ]; then
echo "Wrong dir inside package!"
echo "ERROR: Wrong dir inside package!"
popd >/dev/null
rm -rf "$tmp_dir"
exit 1
@@ -170,7 +170,7 @@ main(){
echo "To: $PROG_PATH/"
if [ ! -d "$PROG_PATH" ]; then
if [ -e "$PROG_PATH" ]; then
echo "Program path is not directory!"
echo "ERROR: Program path is not directory!"
popd >/dev/null
rm -rf "$tmp_dir"
exit 1
@@ -181,6 +181,12 @@ main(){
if [ -z "$PROG_NAME" ]; then
cp -fr * "$PROG_PATH/"
else
if [ ! -f "$PROG_NAME" ]; then
echo "ERROR: $PROG_NAME not found!"
popd >/dev/null
rm -rf "$tmp_dir"
exit 1
fi
if command -v md5sum &>/dev/null; then
echo "Version check"
old_hash=$(md5sum -bz "$PROG_PATH/$PROG_NAME" | awk '{print $1}')