2018-01-08 22:47:21 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-01-23 02:38:16 +00:00
|
|
|
preferred_ports="23 531"
|
|
|
|
fallback_ports="2323 1531"
|
2018-01-08 22:47:21 +00:00
|
|
|
|
|
|
|
# use preferred ports if root,
|
|
|
|
# otherwise use fallback ports
|
|
|
|
[[ $(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
|
|
|
|
[[ "x$1" == "x" ]] &&
|
|
|
|
python -m r0c.__main__ $ports
|
|
|
|
|
|
|
|
# otherwise,
|
|
|
|
# start r0c with the provided password
|
|
|
|
[[ "x$1" == "x" ]] ||
|
|
|
|
python -m r0c.__main__ $ports "$1"
|
2018-01-08 22:47:21 +00:00
|
|
|
|
|
|
|
# usually just "r0c" is enough,
|
|
|
|
# but python 2.6 needs the full "r0c.__main__"
|