Skip to content

Instantly share code, notes, and snippets.

@NullExceptionTSB
Created July 23, 2023 00:09
Show Gist options
  • Save NullExceptionTSB/6f2d17634c793df551038deecc7aea82 to your computer and use it in GitHub Desktop.
Save NullExceptionTSB/6f2d17634c793df551038deecc7aea82 to your computer and use it in GitHub Desktop.
L2J-patcher
#!/bin/bash
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
# Copyright (C) 2004 NullException
#
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name is changed.
#
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
#
# 0. You just DO WHAT THE FUCK YOU WANT TO.
#
echo "L2J-patcher by NullException";
if [ "$#" -ne 1 ]; then
echo "Usage: l2jpatcher [destination]";
exit 1;
fi
read -p "$(pwd)/* > $1/*, Are you sure ? [y/N]: " yn;
if ! [[ "$yn" =~ [Yy] ]]; then
echo "Exitting...";
exit 0;
fi
let c=0
find -type f | (
while read file; do
echo -n "$(pwd)/$file > $1/$file"
exec 3>&2
exec 2> /dev/null
cat $file > $1/$file
if [ $? -eq 0 ]; then
echo " [OK]"
let "c++";
else
echo " [!!]";
fi
exec 3>&2
done
echo "Successfuly updated $c files"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment