-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsquash.bash
More file actions
53 lines (46 loc) · 1.45 KB
/
squash.bash
File metadata and controls
53 lines (46 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
# ===================================================
# NFRAC Squash Script for macOS / Linux
# ===================================================
# Colors
YELLOW='\033[1;33m'
BLUE='\033[1;34m'
NC='\033[0m' # No Color
# Print ASCII Art
echo
echo -e "${YELLOW} ###### ###### ## ## ### ###### ## ## ${NC}"
echo -e "${YELLOW} ## ## ## ## ## ## ## ## ## ## ${NC}"
echo -e "${YELLOW} ##### ## ## ## ## ## ####### ##### ####### ${NC}"
echo -e "${YELLOW} ## ## ## ## ## ## ## ## ## ## ${NC}"
echo -e "${YELLOW} ###### #### ## ###### ## ## ###### ## ## ${NC}"
echo
echo -e "${BLUE} All @copyrights reserved by NFRAC${NC}"
echo
# Check if argument is provided
if [ -z "$1" ]; then
echo "Usage: squash -compress origin_path target_file_name"
echo "Usage: squash -decompress target_file_name.tar.sq"
exit 1
fi
# Compress
if [ "$1" == "-compress" ]; then
if [ -z "$2" ] || [ -z "$3" ]; then
echo "Usage: squash -compress origin_path target_file_name"
exit 1
fi
java Squash -compress "$2" "$3"
exit 0
fi
# Decompress
if [ "$1" == "-decompress" ]; then
if [ -z "$2" ]; then
echo "Usage: squash -decompress target_file_name.tar.sq"
exit 1
fi
java Squash -decompress "$2"
exit 0
fi
# If invalid argument
echo "Usage: squash -compress origin_path target_file_name"
echo "Usage: squash -decompress target_file_name.tar.sq"
exit 1