Skip to content
Snippets Groups Projects
Commit 51b89674 authored by Thibault VINCENT's avatar Thibault VINCENT
Browse files

added missing debian postinst file

parent 8ad98368
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
set -e
CONF="/etc/cc-node.conf"
if [ -f "$CONF" ]; then
# secure the config file
chmod 0640 "$CONF"
# replace login by hostname if unset
if grep '\$\$LOGIN\$\$' "$CONF" >/dev/null; then
login=$(hostname)
print "*** CC-Node login : ${login}"
sed -e "s/\\\$\\\$LOGIN\\\$\\\$/${login}/g" -i "$CONF"
fi
# generate a random password if unset
if grep '\$\$PASSWORD\$\$' "$CONF" >/dev/null; then
password=$(cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 12)
print "*** CC-Node password : ${password}"
sed -e "s/\\\$\\\$PASSWORD\\\$\\\$/${password}/g"\
-i "$CONF"
fi
fi
# Automatically added by dh_pycentral
rm -f /var/lib/pycentral/cc-node.pkgremove
if which pycentral >/dev/null 2>&1; then
pycentral pkginstall cc-node
if grep -qs '^cc-node$' /var/lib/pycentral/delayed-pkgs; then
sed -i '/^cc-node$/d' /var/lib/pycentral/delayed-pkgs
fi
fi
# End automatically added section
# Automatically added by dh_pycentral
rm -f /var/lib/pycentral/cc-node.pkgremove
if which pycentral >/dev/null 2>&1; then
pycentral pkginstall cc-node
if grep -qs '^cc-node$' /var/lib/pycentral/delayed-pkgs; then
sed -i '/^cc-node$/d' /var/lib/pycentral/delayed-pkgs
fi
fi
# End automatically added section
# Automatically added by dh_installinit
if [ -x "/etc/init.d/cc-node" ]; then
update-rc.d cc-node defaults >/dev/null
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
invoke-rc.d cc-node start || exit $?
else
/etc/init.d/cc-node start || exit $?
fi
fi
# End automatically added section
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment