mirror of
https://github.com/Kicksecure/security-misc.git
synced 2025-01-14 03:29:29 -05:00
virusforget
This commit is contained in:
parent
2d867d9fee
commit
416906d4f9
@ -52,6 +52,14 @@ parse_cmd_options() {
|
|||||||
unit_test="true"
|
unit_test="true"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
--commit)
|
||||||
|
commit="true"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--check)
|
||||||
|
check="true"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
--)
|
--)
|
||||||
shift
|
shift
|
||||||
break
|
break
|
||||||
@ -114,7 +122,16 @@ init() {
|
|||||||
|
|
||||||
process_file_system_objects() {
|
process_file_system_objects() {
|
||||||
if [ "$store" = "true" ]; then
|
if [ "$store" = "true" ]; then
|
||||||
rm -r -f "$backup_folder"
|
if [ "$test_mode" = "true" ]; then
|
||||||
|
echo Simulate: rm -r -f "$backup_folder"
|
||||||
|
else
|
||||||
|
rm -r -f "$backup_folder"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$test_mode" = "true" ]; then
|
||||||
|
true
|
||||||
|
else
|
||||||
mkdir -p "$backup_folder"
|
mkdir -p "$backup_folder"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -131,7 +148,11 @@ process_files() {
|
|||||||
full_path_dangerous_dirname="${full_path_dangerous%/*}"
|
full_path_dangerous_dirname="${full_path_dangerous%/*}"
|
||||||
if [ "$store" = "true" ]; then
|
if [ "$store" = "true" ]; then
|
||||||
if [ -e "$full_path_original" ]; then
|
if [ -e "$full_path_original" ]; then
|
||||||
cp --no-dereference --archive "$full_path_original" "$backup_folder/"
|
if [ "$test_mode" = "true" ]; then
|
||||||
|
echo Simulate: cp --no-dereference --archive "$full_path_original" "$backup_folder/"
|
||||||
|
else
|
||||||
|
cp --no-dereference --archive "$full_path_original" "$backup_folder/"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
check_file_walker
|
check_file_walker
|
||||||
@ -169,8 +190,12 @@ process_folders() {
|
|||||||
# echo chattr -i "$full_path_backup"
|
# echo chattr -i "$full_path_backup"
|
||||||
# echo rm "$full_path_backup"
|
# echo rm "$full_path_backup"
|
||||||
#fi
|
#fi
|
||||||
mkdir -p "$full_path_backup_dirname"
|
if [ "$test_mode" = "true" ]; then
|
||||||
cp --no-dereference --archive "$full_path_original" "$full_path_backup_dirname/"
|
echo Simulate: cp --no-dereference --archive "$full_path_original" "$full_path_backup_dirname/"
|
||||||
|
else
|
||||||
|
mkdir -p "$full_path_backup_dirname"
|
||||||
|
cp --no-dereference --archive "$full_path_original" "$full_path_backup_dirname/"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
check_file_walker
|
check_file_walker
|
||||||
@ -310,12 +335,14 @@ init
|
|||||||
variables
|
variables
|
||||||
unit_test_one
|
unit_test_one
|
||||||
|
|
||||||
## TODO
|
if [ "$commit" = "true" ]; then
|
||||||
store=true
|
store=true
|
||||||
process_file_system_objects
|
process_file_system_objects
|
||||||
|
fi
|
||||||
|
|
||||||
unit_test_two
|
unit_test_two
|
||||||
|
|
||||||
## TODO
|
if [ "$check" = "true" ]; then
|
||||||
store=false
|
store=false
|
||||||
process_file_system_objects
|
process_file_system_objects
|
||||||
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user