Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar.sh 1631 2015-05-26 13:33:01Z richard $
|
2 |
# $Id: alcasar.sh 1668 2015-07-19 22:17:07Z richard $
|
3 |
|
3 |
|
4 |
# alcasar.sh
|
4 |
# alcasar.sh
|
5 |
|
5 |
|
6 |
# ALCASAR Install script - CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...]
|
6 |
# ALCASAR Install script - CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...]
|
7 |
# Ce programme est un logiciel libre ; This software is free and open source
|
7 |
# Ce programme est un logiciel libre ; This software is free and open source
|
Line 1336... |
Line 1336... |
1336 |
userdel -r tinyproxy 2>/dev/null
|
1336 |
userdel -r tinyproxy 2>/dev/null
|
1337 |
groupdel tinyproxy 2>/dev/null
|
1337 |
groupdel tinyproxy 2>/dev/null
|
1338 |
fi
|
1338 |
fi
|
1339 |
groupadd -f tinyproxy
|
1339 |
groupadd -f tinyproxy
|
1340 |
useradd -r -g tinyproxy -s /bin/false -c "system user for tinyproxy" tinyproxy
|
1340 |
useradd -r -g tinyproxy -s /bin/false -c "system user for tinyproxy" tinyproxy
|
1341 |
mkdir -p var/run/tinyproxy /var/log/tinyproxy
|
1341 |
mkdir -p /var/run/tinyproxy /var/log/tinyproxy
|
1342 |
chown -R tinyproxy.tinyproxy /run/tinyproxy /var/log/tinyproxy
|
1342 |
chown -R tinyproxy.tinyproxy /var/run/tinyproxy /var/log/tinyproxy
|
1343 |
[ -e /etc/tinyproxy/tinyproxy.conf.default ] || cp /etc/tinyproxy/tinyproxy.conf /etc/tinyproxy/tinyproxy.conf.default
|
1343 |
[ -e /etc/tinyproxy/tinyproxy.conf.default ] || cp /etc/tinyproxy/tinyproxy.conf /etc/tinyproxy/tinyproxy.conf.default
|
1344 |
$SED "s?^User.*?User tinyproxy?g" /etc/tinyproxy/tinyproxy.conf
|
1344 |
$SED "s?^User.*?User tinyproxy?g" /etc/tinyproxy/tinyproxy.conf
|
1345 |
$SED "s?^Group.*?Group tinyproxy?g" /etc/tinyproxy/tinyproxy.conf
|
1345 |
$SED "s?^Group.*?Group tinyproxy?g" /etc/tinyproxy/tinyproxy.conf
|
1346 |
$SED "s?^Port.*?Port 8090?g" /etc/tinyproxy/tinyproxy.conf # Listen Port
|
1346 |
$SED "s?^Port.*?Port 8090?g" /etc/tinyproxy/tinyproxy.conf # Listen Port
|
1347 |
$SED "s?^#Listen.*?Listen $PRIVATE_IP?g" /etc/tinyproxy/tinyproxy.conf # Listen NIC (only intif)
|
1347 |
$SED "s?^#Listen.*?Listen $PRIVATE_IP?g" /etc/tinyproxy/tinyproxy.conf # Listen NIC (only intif)
|
Line 1955... |
Line 1955... |
1955 |
/usr/bin/systemctl -q disable $svc.service
|
1955 |
/usr/bin/systemctl -q disable $svc.service
|
1956 |
done
|
1956 |
done
|
1957 |
# Load and apply the previous conf file
|
1957 |
# Load and apply the previous conf file
|
1958 |
if [ "$mode" = "update" ]
|
1958 |
if [ "$mode" = "update" ]
|
1959 |
then
|
1959 |
then
|
1960 |
$DIR_DEST_BIN/alcasar-archive.sh --now # exports current logs in /var/Save/logs
|
1960 |
$DIR_DEST_BIN/alcasar-archive.sh --now # exports current logs in /var/Save/archive
|
1961 |
$DIR_DEST_BIN/alcasar-conf.sh --load
|
1961 |
$DIR_DEST_BIN/alcasar-conf.sh --load
|
1962 |
PARENT_SCRIPT=`basename $0`
|
1962 |
PARENT_SCRIPT=`basename $0`
|
1963 |
export PARENT_SCRIPT # to avoid stop&start process during the installation process
|
1963 |
export PARENT_SCRIPT # to avoid stop&start process during the installation process
|
1964 |
$DIR_DEST_BIN/alcasar-conf.sh --apply
|
1964 |
$DIR_DEST_BIN/alcasar-conf.sh --apply
|
1965 |
$SED "s?^INSTALL_DATE=.*?INSTALL_DATE=$DATE?g" $CONF_FILE
|
1965 |
$SED "s?^INSTALL_DATE=.*?INSTALL_DATE=$DATE?g" $CONF_FILE
|