diff --git a/src/freedombone b/src/freedombone index 6ece8e7a..8878c0a7 100755 --- a/src/freedombone +++ b/src/freedombone @@ -8032,7 +8032,7 @@ function install_blog { sed -i 's|social.facebook.*|social.facebook = ""|g' /var/www/$FULLBLOG_DOMAIN_NAME/htdocs/config/config.ini sed -i 's|social.twitter.*|social.twitter = ""|g' /var/www/$FULLBLOG_DOMAIN_NAME/htdocs/config/config.ini sed -i 's|social.google.*|social.google = ""|g' /var/www/$FULLBLOG_DOMAIN_NAME/htdocs/config/config.ini - + # create a user password get_blog_admin_password if [ ! $FULLBLOG_ADMIN_PASSWORD ]; then @@ -10288,7 +10288,36 @@ function install_sip { echo "SIP onion domain:$SIP_ONION_HOSTNAME" >> $COMPLETION_FILE fi - systemctl restart sipwitch + systemctl stop sipwitch + + # Note: the existing sipwitch init daemon doesn't appear to work well + # so here we replace it with a systemd one + + # remove the original sipwitch daemon if it exists + if [ -f /etc/init.d/sipwitch ]; then + rm -f /etc/init.d/sipwitch + fi + + # daemon + echo '[Unit]' > /etc/systemd/system/sipwitch.service + echo 'Description=GNU SIP Witch, a SIP telephony service daemon.' >> /etc/systemd/system/sipwitch.service + echo 'After=network.target' >> /etc/systemd/system/sipwitch.service + echo '' >> /etc/systemd/system/sipwitch.service + echo '[Service]' >> /etc/systemd/system/sipwitch.service + echo 'Type=simple' >> /etc/systemd/system/sipwitch.service + echo 'PIDFile=/var/run/sipwitch/pidfile' >> /etc/systemd/system/sipwitch.service + echo 'EnvironmentFile=-/etc/conf.d/sipwitch' >> /etc/systemd/system/sipwitch.service + echo 'EnvironmentFile=-/etc/sipwitch.conf' >> /etc/systemd/system/sipwitch.service + echo 'EnvironmentFile=-/etc/default/sipwitch' >> /etc/systemd/system/sipwitch.service + echo 'ExecStart=/usr/sbin/sipw -f $OPTIONS' >> /etc/systemd/system/sipwitch.service + echo 'Restart=always' >> /etc/systemd/system/sipwitch.service + echo '' >> /etc/systemd/system/sipwitch.service + echo '[Install]' >> /etc/systemd/system/sipwitch.service + echo 'WantedBy=multi-user.target' >> /etc/systemd/system/sipwitch.service + + systemctl enable sipwitch + systemctl daemon-reload + systemctl start sipwitch if ! grep -q $"SIP Server" /home/$MY_USERNAME/README; then echo '' >> /home/$MY_USERNAME/README diff --git a/src/freedombone-upgrade b/src/freedombone-upgrade index c1544085..0644f038 100755 --- a/src/freedombone-upgrade +++ b/src/freedombone-upgrade @@ -152,6 +152,11 @@ if [ -d $PROJECT_DIR ]; then fi fi +# remove the original sipwitch daemon if it exists +if [ -f /etc/init.d/sipwitch ]; then + rm -f /etc/init.d/sipwitch +fi + echo ' ' | reset-tripwire