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 # sympa-utils
utilities for SYMPA 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 #!/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 # 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 # start SSH port translation if needed
if ! ss -tln | grep -q 127.0.0.1:389; then if ! ss -tln | grep -q 127.0.0.1:389; then
ssh -fN listes.artcode.re -L 389:192.168.1.254:389 ssh -fN listes.artcode.re -L 389:192.168.1.254:389
echo 'SSH port translation 389 is now active!'
systemctl restart wwsympa.socket systemctl restart wwsympa.socket
echo 'SSH port translation 389 is now active!'
else else
echo 'SSH already enabled!' echo 'SSH already enabled!'
fi fi

4
bin/export.bash

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

3
bin/import.bash

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

4
bin/purge.bash

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

5
debian/install.bash

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

11
debian/install_zourit_style.bash

@ -1,5 +1,10 @@
#!/usr/bin/env bash #!/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 # 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/.*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 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 fi
done 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