ancient-weatherstation/debian/weatherstation-frontend.pos...

43 lines
1.4 KiB
Bash

#!/bin/sh
# weatherstation-frontend postinst
echo ""
echo "####################################################"
echo "# Achtung: #"
echo "# Bitte lesen Sie die Anleitung zur weiteren #"
echo "# Installation unter: #"
echo "# /usr/share/doc/weatherstation-frontend/reademe #"
echo "# nach! #"
echo "####################################################"
echo ""
if [ -e /etc/weatherstation/chart.conf ]; then
LINKNAME="/usr/share/weatherstation-frontend/$(grep default_chart_dir /etc/weatherstation/frontend.conf | cut -f 2 -d "'" | cut -f 2 -d '"')"
if [ ! -e $LINKNAME ]; then
LINKTARGET=$(grep dflt_image_location /etc/weatherstation/chart.conf | cut -f2)
if [ -e $LINKTARGET ]; then
echo -n "Lege Link zu den Bildern an ... "
/bin/ln -s -f $LINKTARGET $LINKNAME
echo "done"
/bin/chown weatherstation:www-data $LINKTARGET
/bin/chmod 750 $LINKTARGET
fi
fi
fi
if ! getent passwd weatherstation >/dev/null 2>&1; then
echo -n "Creating user/group 'weatherstation'" >&2
adduser --quiet --system --group --no-create-home \
--disabled-password --disabled-login \
--shell /bin/false \
weatherstation
echo "."
fi
# Fixperms:
/bin/chown weatherstation:www-data /etc/weatherstation/frontend.conf
/bin/chmod 440 /etc/weatherstation/frontend.conf
#DEBHELPER#