nutools/lib/uinst/rootconf

96 lines
3.0 KiB
Plaintext
Raw Normal View History

2013-08-27 15:14:44 +04:00
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$@" || exit 1
2014-07-07 22:06:38 +04:00
source "$ULIBDIR/ulib" || exit 1
urequire DEFAULTS
2013-08-27 15:14:44 +04:00
2014-07-07 22:06:38 +04:00
cd "$scriptdir/../.."
2013-08-27 15:14:44 +04:00
log=/tmp/nutools-pyulib-install.log
etitle -s "Installation des packages python"
enote "Le log de l'installation se trouve dans $log"
2014-07-07 22:06:38 +04:00
./uinst -y lib/pyulib >&"$log"
2013-08-27 15:14:44 +04:00
eend
# setup.py laisse des fichiers avec les droits de root, et ces fichiers ne
# peuvent être supprimés par l'utilisateur qui lance uinst. Les supprimer ici.
2014-07-07 22:06:38 +04:00
rm -rf lib/pyulib/build
2013-08-27 15:14:44 +04:00
dest="@@dest@@"
for i in ulib ulibsh; do
2014-07-07 22:06:38 +04:00
sed "s|@@""dest""@@|$dest|g" "lib/ulib/$i" >"/etc/$i"
2013-08-27 15:14:44 +04:00
done
cp lib/ulib/.ulibver /etc/.ulibver
2013-08-27 15:14:44 +04:00
echo >/etc/ulibauto '# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
if [ x"$BASH" != x -a -f /etc/ulib ]; then
. /etc/ulib
elif [ x"$BASH" = x -a -f /etc/ulibsh ]; then
. /etc/ulibsh
else
echo "error: Unable to find required file /etc/ulib" 1>&2
exit 1
fi
uprovide ulibauto
urequire DEFAULTS'
#sed "s|@@""dest""@@|$dest|g" "lib/nulib/load.sh" >"/etc/nulib.sh"
2013-08-27 15:14:44 +04:00
if [ -n "$uninst_utools" ]; then
etitle "Désinstallation de la configuration de utools"
array_from_lines userinfos "$(</etc/passwd awkrun FS=: '$3 == "0" || $6 ~ /^\/home\// { print $1 ":" $6 }')"
for userinfo in "${userinfos[@]}"; do
splitpair "$userinfo" username homedir
[ -d "$homedir/etc/profile.d" -a -d "$homedir/etc/bashrc.d" ] || continue
etitle "$username"
for i in \
profile.d/{backup.userconf,utools,utools.userconf} \
bashrc.d/utools_options.userconf \
default/{apache,backup,webobjects} \
; do
i="$homedir/etc/$i"
[ -f "$i" ] || continue
estep "rm $i"
rm "$i"
done
if [ "$username" == root ]; then
"$dest/uenv"
else
su "$username" "$dest/uenv"
fi
eend
done
eend
fi
if [ -n "$rm_utools" ]; then
etitle "Suppression de /usr/local/utools"
rm -rf /usr/local/utools
eend
fi
2015-08-20 07:58:17 +04:00
[ -n "$kvm_service" ] &&
etitle "Installation du service kvm-stop-all" \
2013-08-27 15:14:44 +04:00
"$scriptdir/../init.d/install-kvm-stop-all"
2015-08-20 07:58:17 +04:00
[ -n "$openvz_service" ] &&
etitle "Installation du service openvz-fix-etchosts" \
2013-08-27 15:14:44 +04:00
"$scriptdir/../init.d/install-openvz-fix-etchosts"
[ -n "$ksus_service" ] &&
etitle "Installation du service kill-ssh-user-sessions" \
"$scriptdir/../init.d/install-kill-ssh-user-sessions"
etitle "Installation des répertoires pour uscrontab"
2014-09-11 19:41:57 +04:00
if [ -d /var/uscrontab -a ! -d /var/local/uscrontab ]; then
eimportant "Migration du répertoire /var/uscrontab vers /var/local/uscrontab"
mkdir -p /var/local &&
mv /var/uscrontab /var/local
fi
mkdir -p /var/local/uscrontab/users &&
chmod 1733 /var/local/uscrontab/users ||
eerror "Impossible de créer le répertoire /var/local/uscrontab/users"
mkdir -p /var/local/uscrontab/users.d &&
chmod 1733 /var/local/uscrontab/users.d ||
eerror "Impossible de créer le répertoire /var/local/uscrontab/users.d"
eend
exit 0