diff options
Diffstat (limited to 'uhub-git.install')
-rw-r--r-- | uhub-git.install | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/uhub-git.install b/uhub-git.install new file mode 100644 index 000000000000..919084d81f6c --- /dev/null +++ b/uhub-git.install @@ -0,0 +1,41 @@ +all_off="$(tput sgr0)" +bold="${all_off}$(tput bold)" +yellow="${bold}$(tput setaf 3)" +blue="${bold}$(tput setaf 4)" +green="${bold}$(tput setaf 2)" + +_instructions() { + printf "${yellow}==>${all_off} ${bold}ATENTION:${all_off}\n" + printf "${blue} ->${all_off} Please run: '${bold}sudo uhub-passwd /etc/uhub/users.db create${all_off}' to create users database.\n" +} + +post_install() { + post_upgrade $1 + + _instructions +} + +post_upgrade() { + + systemd-sysusers uhub.conf + + systemd-tmpfiles --create uhub.conf + + install -dm744 -o uhub -g uhub /var/log/uhub + install -dm744 -o uhub -g uhub /var/lib/uhub +} + +post_remove() { + paths=(/etc/uhub /var/lib/uhub /var/log/uhub) + + first=true + for path in ${paths[@]}; do + if [ -d $path ]; then + if $first; then + first=false + printf "${green}==>${all_off} ${bold}Leftover Paths:${all_off}\n" + fi + printf "${blue} -> ${all_off} ${bold}$path${all_off}\n" + fi + done +} |