Run scripts from the Internet more securely than `curl | bash` (experimental)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
412 B

2 years ago
import requests
import subprocess
import sys
url = sys.argv[1]
content = requests.get(url).content
subprocess.run(["less"], input=content)
2 years ago
while True:
response = (
input("Do you want to run this script? [y/n] ").lower().strip()[0]
)
if response == "y":
subprocess.run(["bash"], input=content)
2 years ago
break
elif response == "n":
print("Script not run.")
2 years ago
break