Browse Source

execute as root or use `sudo`

main
pvincent 1 day ago
parent
commit
cba9aaf8a5
  1. 5
      README.md
  2. 7
      bin/apply_auth_remote_ssh.bash
  3. 4
      bin/export.bash
  4. 3
      bin/import.bash
  5. 4
      bin/purge.bash
  6. 5
      debian/install.bash
  7. 11
      debian/install_zourit_style.bash

5
README.md

@ -1,3 +1,8 @@
# sympa-utils
utilities for SYMPA
## usage
* # prepend by `sudo`
* sudo bin/purge.bash

7
bin/apply_auth_remote_ssh.bash

@ -1,13 +1,16 @@
#!/usr/bin/env bash
# execute as root or use `sudo`
[[ $(id -u) != 0 ]] && exec sudo $(dirname "$0")/$(basename "$0")
# changes in /etc/sympa/auth.conf
sed -i 's/.*host 192.168.1.254:389.*/ host 127.0.0.1:389 # remote connection through SSH/' /etc/sympa/auth.conf
sed -i 's/.*host 192.168.1.254:389.*/\thost 127.0.0.1:389/' /etc/sympa/auth.conf
# start SSH port translation if needed
if ! ss -tln | grep -q 127.0.0.1:389; then
ssh -fN listes.artcode.re -L 389:192.168.1.254:389
echo 'SSH port translation 389 is now active!'
systemctl restart wwsympa.socket
echo 'SSH port translation 389 is now active!'
else
echo 'SSH already enabled!'
fi

4
bin/export.bash

@ -39,6 +39,8 @@ function export {
### MAIN
set -Eeu
# execute as root or use `sudo`
[[ $(id -u) != 0 ]] && exec sudo $(dirname "$0")/$(basename "$0")
set -Eeu
export

3
bin/import.bash

@ -129,6 +129,9 @@ function import {
## main
# execute as root or use `sudo`
[[ $(id -u) != 0 ]] && exec sudo $(dirname "$0")/$(basename "$0")
set -Eeu
assert_file $*
import

4
bin/purge.bash

@ -82,6 +82,8 @@ function export {
### MAIN
set -Eeu
# execute as root or use `sudo`
[[ $(id -u) != 0 ]] && exec sudo $(dirname "$0")/$(basename "$0")
set -Eeu
purge

5
debian/install.bash

@ -1,3 +1,8 @@
#!/usr/bin/env bash
## MAIN
# execute as root or use `sudo`
[[ $(id -u) != 0 ]] && exec sudo $(dirname "$0")/$(basename "$0")
echo TODO...

11
debian/install_zourit_style.bash

@ -1,5 +1,10 @@
#!/usr/bin/env bash
## MAIN
# execute as root or use `sudo`
[[ $(id -u) != 0 ]] && exec sudo $(dirname "$0")/$(basename "$0")
# changes in /usr/share/sympa/lib/Sympa/Config/Schema.pm
sed -i "s/.*005ab2.*/ default => '#ad0c78', # '#005ab2' replaced by ZOURIT-COLOR-1/" /usr/share/sympa/lib/Sympa/Config/Schema.pm
sed -i "s/.*004b94.*/ default => '#1f2937', # '#004b94' replaced by ZOURIT-COLOR-2/" /usr/share/sympa/lib/Sympa/Config/Schema.pm
@ -23,5 +28,7 @@ for i in /var/lib/sympa/css/*; do
fi
done
[[ $socket_restart == true ]] && systemctl restart wwsympa.socket && echo "wwsympa restarted with fresh styles"
true
if $socket_restart; then
systemctl restart wwsympa.socket
echo "wwsympa restarted with fresh styles"
fi
Loading…
Cancel
Save