diff options
author | reztho | 2015-06-13 23:21:53 +0100 |
---|---|---|
committer | reztho | 2015-06-13 23:21:53 +0100 |
commit | 666bf437c172a788175fd903ab80fd5d6e64fafd (patch) | |
tree | 30d6a8c7f31c5355e9af6bfd43f9808a365c9373 /dkms-frandom.install | |
download | aur-666bf437c172a788175fd903ab80fd5d6e64fafd.tar.gz |
Initial commit
Diffstat (limited to 'dkms-frandom.install')
-rw-r--r-- | dkms-frandom.install | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/dkms-frandom.install b/dkms-frandom.install new file mode 100644 index 000000000000..18ba932f418c --- /dev/null +++ b/dkms-frandom.install @@ -0,0 +1,39 @@ +post_install (){ + DKMS=$(which dkms) + + $DKMS add -m frandom -v 1.1 + $DKMS build -m frandom -v 1.1 + $DKMS install -m frandom -v 1.1 + /usr/bin/depmod -a +} + +pre_upgrade(){ + pre_remove +} + +post_upgrade(){ + post_install +} + +pre_remove (){ + _inmemory=$(/usr/bin/lsmod | /usr/bin/grep frandom) + if [ ! -z "$_inmemory" ]; then + /usr/bin/rmmod frandom &> /dev/null + fi + + DKMS=$(which dkms) + + _line=$($DKMS status -m frandom) + if echo "$_line" | grep -E 'added|built|installed'; then + version=$(echo "$_line" | sed 's/frandom,\([^,]*\)[,:].*/\1/;t;d') + $DKMS remove -m frandom -v $version --all + fi +} + +post_remove () { + /usr/bin/depmod -a +} + +op=$1 +shift +$op $* |