-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
52 lines (42 loc) · 1.26 KB
/
Copy pathinstall.sh
File metadata and controls
52 lines (42 loc) · 1.26 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
#!/bin/bash
if [ "$USER" = 'root' ]
then
echo "User is good when root 0.0"
else
echo "User is not root -.-"
echo "Run as root!"
exit 1
fi
# Installing Testdisk
testdisk /version >> /dev/null
if [ "$?" = 0 ]
then
echo "Testdisk already installed"
else
read -p "Do you wish to install Testdisk? (Y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1
echo "Installing Testdisk..."
if [[ ! -z $(which apt-get) ]]; then
#Debian
sudo apt-get update
sudo apt-get upgrade
sudo apt-get --force-yes -y install testdisk
elif [[ ! -z $(which yum) ]]; then
#RHEL/CentOS 8
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo yum update
sudo yum install testdisk -y
elif [[ ! -z $(which dnf) ]]; then
#Fedora
sudo dnf install testdisk -y
elif [[ ! -z $(which pkg) ]]; then
#Arch
sudo pacman -S testdisk
else
echo "Failed to get a package manager! Get it manually."
echo "https://www.cgsecurity.org/wiki/TestDisk"
exit 1
fi
echo "Testdisk installed successfully"
fi
echo "Starting recovery"
sudo bash recover.sh