r0c/start-r0c.sh

24 lines
509 B
Bash
Raw Normal View History

#!/bin/bash
2018-01-23 02:38:16 +00:00
preferred_ports="23 531"
fallback_ports="2323 1531"
# use preferred ports if root,
# otherwise use fallback ports
2020-01-19 19:06:16 +00:00
[ $(id -u) -eq 0 ] &&
ports="$preferred_ports" ||
ports="$fallback_ports"
2018-03-20 04:11:18 +00:00
# if no arguments:
# start r0c with password from config file
2020-01-19 19:06:16 +00:00
[ "x$1" == "x" ] &&
2021-09-19 15:22:48 +00:00
python3 -m r0c.__main__ $ports
2018-03-20 04:11:18 +00:00
# otherwise,
# start r0c with the provided password
2020-01-19 19:06:16 +00:00
[ "x$1" == "x" ] ||
2021-09-19 15:22:48 +00:00
python3 -m r0c.__main__ $ports "$1"
# usually just "r0c" is enough,
# but python 2.6 needs the full "r0c.__main__"