Skip to content

Commit

Permalink
Merge pull request #2253 from Ace-Tang/add_completion_pkg
Browse files Browse the repository at this point in the history
package: add bash completion file into rpm
  • Loading branch information
allencloud authored Oct 18, 2018
2 parents 1e71757 + c252744 commit 16971f1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
15 changes: 11 additions & 4 deletions hack/package/rpm/scripts/after-install.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
#!/usr/bin/env bash
if [ "$1" -eq 1 ] ; then
systemctl preset pouch > /dev/null 2>&1

systemctl preset pouch > /dev/null 2>&1
fi
if ! getent group pouch > /dev/null; then
groupadd --system pouch
groupadd --system pouch
fi

if [ ! -d "/var/lib/pouch-lxcfs" ] ; then
mkdir -p /var/lib/pouch-lxcfs
fi
fi

BASEDIR="$( dirname "$0" )/../../../.."
COMPLETION_FILE="$BASEDIR/contrib/completion/bash/pouch"
DEST="/usr/share/bash-completion/completions"

if [ -f "$COMPLETION_FILE" ];then
cp "$COMPLETION_FILE" "$DEST"
fi
5 changes: 5 additions & 0 deletions hack/package/rpm/scripts/after-remove.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ systemctl daemon-reload > /dev/null 2>&1
if [ "$1" -ge 1 ] ; then
systemctl try-restart pouch > /dev/null 2>&1
fi

COMPLETION_FILE="contrib/completion/bash/pouch"
if [ -f "$COMPLETION_FILE" ];then
rm -f $COMPLETION_FILE
fi

0 comments on commit 16971f1

Please sign in to comment.