Skip to content

Commit

Permalink
bug fix: MacOS problem
Browse files Browse the repository at this point in the history
  • Loading branch information
ali77gh committed Feb 7, 2022
1 parent 9244e94 commit dc73947
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fi

# download
echo "downloading..."
wget -q -O - https://github.com/ali77gh/shecan-cli/releases/download/1.2.0/shecan.py > temp.py
wget -q -O - https://github.com/ali77gh/shecan-cli/releases/download/1.2.1/shecan.py > temp.py
echo "done"

# copy
Expand Down
4 changes: 2 additions & 2 deletions shecan.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def local_status() -> bool:
def enable():
# backup
result = os.popen(f"networksetup -getdnsservers {interface}").read()
f = open(dns_file_bak,"w")
f = open(dns_file_bak_mac,"w")
f.write(result)

# enable
Expand All @@ -108,7 +108,7 @@ def enable():

@staticmethod
def disable():
f = open(dns_file_bak,"r")
f = open(dns_file_bak_mac,"r")
old_dns = f.read()
os.system(f"networksetup -setdnsservers {interface} {old_dns}")
pass
Expand Down

0 comments on commit dc73947

Please sign in to comment.