-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
64 lines (52 loc) · 1.64 KB
/
run.sh
File metadata and controls
64 lines (52 loc) · 1.64 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
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
#You can run this script again and again, if you want to change your e-mail or password
if [[ $1 = '-r' ]]
then
sudo crontab -l >> f.txt
sed -i "/python3 \/bin\/code0.py/d" f.txt
sudo crontab f.txt
sudo rm f.txt
sudo rm /bin/code0.py
elif [[ $1 = '-i' ]]
then
echo " "
echo " /▔▔▔▔▔▔▔▔▔▔▔▔▔▔\ "
echo " / |▔▔▔▔▔| \ "
echo " \ \ \▔/ / / "
echo " \___|_|▔|_|____/ "
echo " "
read -p 'Enter Your Email [From ] : ' frommail
read -p 'Enter Your Email Password: ' password
read -p 'Enter Email [To ]: ' tomail
echo ""
echo -e 'Installing.... /'
sleep .5
echo -e '\033[A\rInstalling.... |'
sleep .5
echo -e '\033[A\rInstalling.... \'
sleep .5
echo -e '\033[A\rInstalling.... -'
sleep .5
echo -e "\033[A\r "
sudo cp code.py code0.py
sed -i "24i Frommail = \"$frommail\"" code0.py
sed -i "25i Password = \"$password\"" code0.py
sed -i "26i Tomail = \"$tomail\"" code0.py
sed -i "27i MailSubject = \" ---> ALERT FROM YOUR PC <--- \"" code0.py
sudo mv code0.py /bin/
sudo crontab -l >> tmpcrontab.txt
sudo echo "@reboot python3 /bin/code0.py &" >> tmpcrontab.txt
sudo uniq tmpcrontab.txt >> tmpcrontab1.txt
sudo rm tmpcrontab.txt
sudo crontab tmpcrontab1.txt
sudo rm tmpcrontab1.txt
else
echo '''Usage: ./run.sh [OPTIONS]
Options
-i : Installs the script in your computer
-r : Removes the script from your computer
--help or -h : Prints this.
You can run this script again and again,
if you want to change your e-mail or password
For example, ./run.sh -i: will install the script'''
fi