-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.py
37 lines (28 loc) · 1.05 KB
/
install.py
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
import os, platform
def install_linkfinder():
if os.geteuid() != 0:
print("Please run this script with root privileges.")
exit(1)
directory = "/usr/share/ihaahi"
if not os.path.exists(directory):
os.system("mkdir {}".format(directory))
os.system("mkdir /usr/share/ihaahi/LinkFinder")
os.system("mv linkfinder /usr/share/ihaahi/LinkFinder")
with open("/usr/local/bin/linkfinder", "w") as wrt:
wrt.write("#!/bin/bash\n")
wrt.write('all=""\n')
wrt.write('for arg in "$@"; do\n')
wrt.write(' all=$all$arg" "\n')
wrt.write('done\n')
wrt.write('python3 /usr/share/ihaahi/LinkFinder/linkfinder $all')
os.system("chmod +x /usr/local/bin/linkfinder")
print("linkfinder installed successfully.")
print("type 'linkfinder' to use this tool")
def Main():
os_system = platform.system()
if os_system == "Linux":
install_linkfinder()
else:
print("type 'python3 linkfinder' to use this tool")
if __name__ == "__main__":
Main()