push
This commit is contained in:
2
main.nix
2
main.nix
@@ -61,12 +61,14 @@
|
|||||||
pid = "pi \"cd $(pwd) && bash\"";
|
pid = "pi \"cd $(pwd) && bash\"";
|
||||||
|
|
||||||
pico = "ssh pico.sh";
|
pico = "ssh pico.sh";
|
||||||
|
|
||||||
# tuns name port
|
# tuns name port
|
||||||
tuns = "bash -c '\''if [ \"$#\" -ne 2 ]; then echo \"Usage: tun name port\"; exit 1; fi;
|
tuns = "bash -c '\''if [ \"$#\" -ne 2 ]; then echo \"Usage: tun name port\"; exit 1; fi;
|
||||||
if [[ \"$1\" =~ ^[0-9]+$ ]]; then port=\"$1\"; name=\"$2\";
|
if [[ \"$1\" =~ ^[0-9]+$ ]]; then port=\"$1\"; name=\"$2\";
|
||||||
elif [[ \"$2\" =~ ^[0-9]+$ ]]; then port=\"$2\"; name=\"$1\";
|
elif [[ \"$2\" =~ ^[0-9]+$ ]]; then port=\"$2\"; name=\"$1\";
|
||||||
else echo \"Error: One argument must be a number (port)\"; exit 1; fi;
|
else echo \"Error: One argument must be a number (port)\"; exit 1; fi;
|
||||||
ssh -R \"$\{name}:80:localhost:$\{port}\" tuns.sh'\'' _";
|
ssh -R \"$\{name}:80:localhost:$\{port}\" tuns.sh'\'' _";
|
||||||
|
|
||||||
# pgs name directory
|
# pgs name directory
|
||||||
pgs = "bash -c '\''if [ \"$#\" -ne 2 ]; then echo \"Usage: pgs NAME DIRECTORY\"; exit 1; fi; rsync -rv \"$2\" pgs.sh:/\"$1\"'\'' _";
|
pgs = "bash -c '\''if [ \"$#\" -ne 2 ]; then echo \"Usage: pgs NAME DIRECTORY\"; exit 1; fi; rsync -rv \"$2\" pgs.sh:/\"$1\"'\'' _";
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user