dcu-container-toolkit.postinst 889 Bytes
Newer Older
songlinfeng's avatar
songlinfeng committed
1
2
3
4
5
6
7
8
#!/bin/sh

set -e

NVIDIA_CONTAINER_RUNTIME_HOOK=/usr/bin/nvidia-container-runtime-hook

case "$1" in
    configure)
9
        /usr/bin/dcu-ctk --quiet config --config-file=/etc/dcu-container-runtime/config.toml --in-place
songlinfeng's avatar
songlinfeng committed
10
        if [ ! -e "${NVIDIA_CONTAINER_RUNTIME_HOOK}" ]; then
11
            ln -s /usr/bin/dcu-ctk $NVIDIA_CONTAINER_RUNTIME_HOOK
songlinfeng's avatar
songlinfeng committed
12
13
        fi

14
        /usr/bin/dcu-ctk runtime configure --runtime=docker --set-as-default
songlinfeng's avatar
songlinfeng committed
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
        echo -e "\e[032m ================================== \e[0m"
        echo -e "\e[033m Please restart Docker service:     \e[0m"
        echo -e "\e[033m    sudo systemctl restart docker   \e[0m"
        echo -e "\e[032m ================================== \e[0m"
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

#DEBHELPER#

exit 0