-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathServer.bat
56 lines (41 loc) · 1.41 KB
/
Server.bat
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
@echo off
title Python upload server 1.1
echo --------------------------------------------------------------------------
echo[
echo Python upload server v1.1
echo[
echo --------------------------------------------------------------------------
echo[
echo ** This application requires Python to be installed on the Server
echo[
echo * Files in the Uploads folder are accessible on the local network
echo --------------------------------------------------------------------------
echo[
echo Making Uploads folder
echo[
mkdir Uploads
Rem creating an Uploads directory if it doesn't exist.
echo Setup in progress, please wait
echo[
python get-pip.py
cd Uploads
pip install uploadserver
pip install qrcode
echo[
FOR /F "tokens=4 delims= " %%i in ('route print ^| find " 0.0.0.0"') do set localIp=%%i
echo Server IP Address on WIFI is: %localIp%
echo Address to access : %localIp%:8000
echo[
echo Scan the qr bellow to access if Server is connected to WIFI
qr --ascii "http://%localIp%:8000/"
for /f "tokens=3 delims=: " %%i in ('netsh interface ip show config name^="Ethernet" ^| findstr "IP Address" ^| findstr [0-9]') do set IP=%%i
echo Server IP Address on Ethernet is: %IP%
echo Address to access when server is on Ethernet : %IP%:8000
echo[
echo Scan the qr bellow to access if Server is connected to Ethernet
qr --ascii "http://%IP%:8000/"
echo Press ctrl+C twice to exit
echo[
echo[
python -m uploadserver
pause