OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.3 KiB

  1. #!/bin/sh
  2. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. #
  5. # Filename: package/.../vcd/vcd.postinstall
  6. # Copyright (C) 2006 The OpenSDE Project
  7. #
  8. # More information can be found in the files COPYING and README.
  9. #
  10. # This program is free software; you can redistribute it and/or modify
  11. # it under the terms of the GNU General Public License as published by
  12. # the Free Software Foundation; version 2 of the License. A copy of the
  13. # GNU General Public License can be found in the file COPYING.
  14. # --- SDE-COPYRIGHT-NOTE-END ---
  15. VXDB=D_localstatedir/vcd/vxdb
  16. if [ ! -f "$VXDB" ]; then
  17. echo "Creating vcd's database ..."
  18. cat D_datadir/vcd/vxdb.sql | sqlite3 "$VXDB"
  19. chmod 600 "$VXDB"
  20. if [ -n "`type -p apg`" ]; then
  21. echo "Creating initial password for vshelper ..."
  22. password="$( apg -a 0 -M nlc -n 1 -E "'\"," )"
  23. vxpasswd "$VXDB" vshelper "$password"
  24. sed -i -e "s,^\(pass\)[ \t]*=.*,\1 = $password," \
  25. -e "s,^\(user\)[ \t]*=.*,\1 = vshelper," \
  26. D_sysconfdir/vshelper.conf
  27. echo "Done."
  28. else
  29. echo "Warning: it was not possible to generate a default password"
  30. echo " for vshelper"
  31. fi
  32. fi
  33. if ! grep -q vshelper /etc/sysctl.conf; then
  34. echo "Activating vshelper ..."
  35. cat <<-EOT >> /etc/sysctl.conf
  36. # VServer helper
  37. kernel.vshelper = D_sbindir/vshelper
  38. EOT
  39. sysctl -p
  40. echo "Done."
  41. fi