Commit ab1e6d83 authored by Marcus Nordenberg's avatar Marcus Nordenberg Committed by Esteban Blanc

pkg: fixed some issues with pwrrt package

(cherry picked from commit d9b814bae42600f4cf722d635f46c883c31c3525)
parent 5b5d1256
......@@ -92,6 +92,7 @@ else
fi
fi
# Add the user b66
if getent passwd b66 >/dev/null; then
echo "-- User b66 already exist. OK!"
else
......@@ -143,14 +144,12 @@ if [ ! -e /etc/proview.cnf ]; then
new_cnf=1
fi
# Source pwrp_profile from both profile and bash.bashrc
for cnf_file in /etc/profile /etc/bash.bashrc; do
if ! grep -q "/etc/pwrp_profile\b" ${cnf_file}; then
cat >> ${cnf_file} <<-EOF
[[ -e /etc/pwrp_profile ]] && . /etc/pwrp_profile
EOF
fi
done
# Source pwrp_profile in login shells
if [ ! -e /etc/profile/pwrp_profile.sh ]; then
# profile.d should always exist on a modern debian system. BUT if it doesn't we create it :)
if [ ! -e /etc/profile.d ]; then mkdir /etc/profile.d; fi
echo "[[ -e /etc/pwrp_profile ]] && . /etc/pwrp_profile" > /etc/profile.d/pwrp_profile.sh
fi
# Create startup link
# set +e
......
......@@ -7,3 +7,5 @@ if [ "$1" = "purge" -a -e /etc/proview.cnf ]; then
rm /etc/proview.cnf
echo "-- Purged /etc/proview.cnf"
fi
if [ -e /etc/profile.d/pwrp_profile.sh ]; then rm /etc/profile.d/pwrp_profile.sh; fi
......@@ -14,24 +14,26 @@ fi
proot="/pwrp"
aroot="/usr/pwrp"
echo ""
echo -n "Do you want to remove project and users (y/n) [n] "
read remove_all
if [ "$remove_all" = "y" ]; then
for user in pwrp skiftel b55 b66; do
getent passwd ${user} >/dev/null 2>&1 && userdel -rf ${user} 2>/dev/null
echo "-- Removed user ${user}"
done
for grp in pwrp skiftel b55 b66; do
getent group ${grp} >/dev/null 2>&1 && groupdel ${grp}
echo "-- Removed group ${grp}"
done
echo "-- Removing projects..."
if [ -e $proot ]; then
rm -r $proot && echo "-- Removed project $proot"
fi
if [ -e $aroot ]; then
rm -r $aroot && echo "-- Removed admin directory $proot"
if [ ! "$1" = "upgrade" ]; then
echo ""
echo -n "Do you want to remove project and users (y/n) [n] "
read remove_all
if [ "$remove_all" = "y" ]; then
for user in pwrp skiftel b55 b66; do
getent passwd ${user} >/dev/null 2>&1 && userdel -rf ${user} 2>/dev/null
echo "-- Removed user ${user}"
done
for grp in pwrp skiftel b55 b66; do
getent group ${grp} >/dev/null 2>&1 && groupdel ${grp}
echo "-- Removed group ${grp}"
done
echo "-- Removing projects..."
if [ -e $proot ]; then
rm -r $proot && echo "-- Removed project $proot"
fi
if [ -e $aroot ]; then
rm -r $aroot && echo "-- Removed admin directory $aroot"
fi
fi
fi
......
......@@ -19,7 +19,7 @@ export pwr_load=$pwrb_root/load
export pwr_lis=$pwrb_root/lis
export pwr_doc=$pwrb_root/doc
# Fetch arch
# Fetch arch (In the rare cases where we run 32-bit proview on 64-bit debian)
if [ -e /pwrp ]; then
for dir in `ls -1 /pwrp`; do
[[ "${dir}" == "common" ]] && continue
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment