diff --git a/etc/default/dhcpcd b/etc/default/dhcpcd new file mode 100644 index 0000000..73d45db --- /dev/null +++ b/etc/default/dhcpcd @@ -0,0 +1,2 @@ +# Specify for which interfaces you want dhcpcd to run +#IFACES="" diff --git a/etc/default/psd b/etc/default/psd new file mode 100644 index 0000000..926e9ba --- /dev/null +++ b/etc/default/psd @@ -0,0 +1,5 @@ +# Users for which psd should be enabled +#USERS="" + +# If $USERS is empty, scan for users that run psd and store them in this file. +#USERS_CACHE="/run/psd-users.cache" diff --git a/etc/rc.d/rc.dhcpcd b/etc/rc.d/rc.dhcpcd index a1b0eea..80c54b6 100644 --- a/etc/rc.d/rc.dhcpcd +++ b/etc/rc.d/rc.dhcpcd @@ -4,15 +4,22 @@ # # Start/stop the DHCP daemon. # -# This script doesn't do anything other than starting dhcpcp for all interfaces. For more functionality see rc.inet1. +# This script doesn't do anything other than starting dhcpcp for the specified interfaces (or all of them). For more functionality see rc.inet1. + +IFACES="" +if [ -f /etc/default/dhcpcd ]; then + . /etc/default/dhcpcd +fi case "$1" in 'start') - dhcpcd -b + shift + dhcpcd -b ${@:-$IFACES} ;; 'stop') - dhcpcd -k + shift + dhcpcd -k ${@:-$IFACES} ;; *) - echo "Usage: $0 start|stop" + echo "Usage: $0 start|stop [interfaces]" esac diff --git a/etc/rc.d/rc.psd b/etc/rc.d/rc.psd index 5c0d30b..f051477 100644 --- a/etc/rc.d/rc.psd +++ b/etc/rc.d/rc.psd @@ -10,6 +10,9 @@ USERS="" USERS_CACHE="/run/psd-users.cache" +if [ -f /etc/default/psd ]; then + . /etc/default/psd +fi scan_users() { rm -f "$USERS_CACHE"