-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproxy.sh
executable file
·29 lines (17 loc) · 897 Bytes
/
proxy.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
#linux system script to set mec system proxy in terminal
#rename the file as proxy.sh
#run chmod +x proxy.sh to set the script as executable
#! /bin/bash
cd /etc/apt;
sudo touch apt.conf;
sudo sh -c 'echo "Acquire::http::proxy \"http://mec:[email protected]:3128\";
\nAcquire::https::proxy \"https://mec:[email protected]:3128\";
\nAcquire::ftp::proxy \"ftp://mec:[email protected]:3128\";\n"> apt.conf';
cat apt.conf;
#JACOB LUKOSE
#( stack overflow )
# echo "[some repository]" | sudo tee -a /etc/apt/sources.list
# The tee command is called as the superuser via sudo and the -a argument tells tee to append to the file instead of overwriting it.
# Your original command failed, as the IO redirection with >> will be done as the regular user, only your echo was executed with sudo.
# Calling a sudo 'subshell' like
# sudo sh -c 'echo "[some repository]" >> /etc/apt/sources.list'