diff --git a/mkosi.extra/usr/bin/set-up-systemd-extension b/mkosi.extra/usr/bin/set-up-systemd-extension old mode 100644 new mode 100755 index 4b72573..83718ea --- a/mkosi.extra/usr/bin/set-up-systemd-extension +++ b/mkosi.extra/usr/bin/set-up-systemd-extension @@ -11,9 +11,6 @@ usage() { set -e -# Test to see if the user added a name for their extension. Otherwise use 'kde' -SYSEXT_NAME="kde" - # Check for parameters (see "usage" function above) while getopts "n:d:h" option; do case "${option}" in @@ -23,16 +20,32 @@ while getopts "n:d:h" option; do d) SYSEXT_DIR="$OPTARG" ;; - h | *) + h) usage exit 0 ;; esac done + +# If name has not been defined, offer the user the possibility of defining it now or accepting the default 'kde' + +if [ -z ${SYSEXT_NAME} ]; then + echo -e "Extension name [default: kde]: \c" + read -r + SYSEXT_NAME="${REPLY:-kde}" +fi + # If a directory has been defined, the extension will be under 'directory/name'; if not, the extension will be under 'name' + if [ -z ${SYSEXT_DIR} ]; then - SYSEXT_DIR="${SYSEXT_NAME}" + echo -e "Extension directory [default: current directory]: \c" + read -r + if [ -z "${REPLY}" ]; then + SYSEXT_DIR="${SYSEXT_NAME}" + else + SYSEXT_DIR="${REPLY}/${SYSEXT_NAME}" + fi else SYSEXT_DIR="${SYSEXT_DIR}/${SYSEXT_NAME}" fi