diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2018-02-26 10:54:58 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2018-02-26 10:54:58 +0100 |
commit | e0413089bdf3ddf423c0f6a7e8a2b82dba3ee222 (patch) | |
tree | 523caef3401f43223c8027e54b932fc43c9734f5 /install-itzks-workstation | |
parent | 731b6f711e85573ca05960e7089bab97289c48e1 (diff) | |
download | itzks-install-script-e0413089bdf3ddf423c0f6a7e8a2b82dba3ee222.tar.gz itzks-install-script-e0413089bdf3ddf423c0f6a7e8a2b82dba3ee222.tar.bz2 itzks-install-script-e0413089bdf3ddf423c0f6a7e8a2b82dba3ee222.zip |
apt_install_if_not: Explicitly support command line options.
Diffstat (limited to 'install-itzks-workstation')
-rwxr-xr-x | install-itzks-workstation | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/install-itzks-workstation b/install-itzks-workstation index 9eeaba1..79250fc 100755 --- a/install-itzks-workstation +++ b/install-itzks-workstation @@ -17,12 +17,17 @@ set -e set -x function apt_install_if_not() { - pkgs=$@ + pkgs_and_opts=$@ install_pkgs="" - for pkg in $pkgs; do - [ -d "/usr/share/doc/$pkg" ] || install_pkgs="$install_pkgs $pkg" + options="" + for param in $pkgs_and_opts; do + echo "$param" | grep -qE '^-' && { + options="$options $param" + } || { + [ -d "/usr/share/doc/$param" ] || install_pkgs="$install_pkgs $param" + } done - test -n "$install_pkgs" && apt-get install -y $install_pkgs || true + test -n "$install_pkgs" && apt-get install -y $options $install_pkgs || true } # Add user locadm if not already there |