#! /bin/sh #---------------------------------------------------------------------------------------- # /usr/bin/archimapinit - create initial configuration file for IMAP archiver # # Copyright (c) 2001-2025 The Eisfair Team, team(at)eisfair(dot)org # # Creation: 2004-04-20 jed # Last Update: $Id$ # # Parameters: # # 1. su - username # 2. archimapinit # or # archimapinit username - check configuration file # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------------------- # read eislib . /var/install/include/eislib if [ $# -eq 0 ] then # get current user user=`whoami` if [ "${user}" = "root" ] then mecho --error "error: user 'root' isn't allowed" mecho mecho --error "use '$0 username' to set username" exit 1 fi else # set user user=${1} fi # get home directory if getent passwd ${user} >/dev/null 2>&1 then # account exists - go on... if [ "${user}" != "`whoami`" ] then su - "${user}" -s /bin/sh -c "/var/install/config.d/archimap.sh --init" else /var/install/config.d/archimap.sh --init fi else mecho --error "error: user couldn't be found: ${user}" mecho mecho --error "use '${0} username' to set username" exit 1 fi