diff --git a/src/glacier b/src/glacier index 752c52b..1883a88 100755 --- a/src/glacier +++ b/src/glacier @@ -164,6 +164,10 @@ cleanup () { cd .. && rm -rf *.checksum *.tar.* $2 } +pre_hooks() { + source /etc/glacier/hooks +} + post_hooks () { printf "$blue[ i ]$reset Executing post-operation hooks...\n" /etc/glacier/post-hooks @@ -216,8 +220,9 @@ case $1 in if [[ $REPLY =~ ^[Yy]$ ]]; then cd /opt/glacier/workspace printf "\n" + pre_hooks "$@" get_pkg "$@" - int_check # Will implement this later on + int_check "$@" unpack_pkg "$@" installpkg "$@" post_hooks "$@" @@ -242,8 +247,9 @@ case $1 in if [[ $REPLY =~ ^[Yy]$ ]]; then cd /opt/glacier/workspace printf "\n" + pre_hooks "$@" get_pkg "$@" - int_check + int_check "$@" unpack_pkg "$@" updatepkg "$@" post_hooks "$@" @@ -268,8 +274,9 @@ case $1 in if [[ $REPLY =~ ^[Yy]$ ]]; then cd /opt/glacier/workspace printf "\n" + pre_hooks "$@" get_pkg "$@" - int_check + int_check "$@" unpack_pkg "$@" removepkg "$@" post_hooks "$@" @@ -304,7 +311,7 @@ case $1 in cd /var/cache/glacier printf "\n" get_pkg "$@" - int_check + int_check "$@" printf "$green[ $check ]$reset Operation completed.\n" exit 0 fi @@ -327,6 +334,7 @@ case $1 in mv $2.tar.gz /opt/glacier/workspace cd /opt/glacier/workspace printf "\n" + pre_hooks "$@" unpack_pkg "$@" installpkg "$@" post_hooks "$@"