瀏覽代碼

Fix sed for irc port changes

Bob Mottram 9 年之前
父節點
當前提交
b25f9b1de8
共有 2 個檔案被更改,包括 6 行新增6 行删除
  1. 2
    2
      src/freedombone
  2. 4
    4
      src/freedombone-controlpanel

+ 2
- 2
src/freedombone 查看文件

7452
     sed -i 's|;DHFile = /etc/ngircd/dhparams.pem|DHFile = /etc/ssl/certs/ngircd.dhparam|g' /etc/ngircd/ngircd.conf
7452
     sed -i 's|;DHFile = /etc/ngircd/dhparams.pem|DHFile = /etc/ssl/certs/ngircd.dhparam|g' /etc/ngircd/ngircd.conf
7453
     sed -i 's|;KeyFile = /etc/ssl/private/server.key|KeyFile = /etc/ssl/private/ngircd.key|g' /etc/ngircd/ngircd.conf
7453
     sed -i 's|;KeyFile = /etc/ssl/private/server.key|KeyFile = /etc/ssl/private/ngircd.key|g' /etc/ngircd/ngircd.conf
7454
     if [[ $ONION_ONLY != 'yes' ]]; then
7454
     if [[ $ONION_ONLY != 'yes' ]]; then
7455
-        sed -i ":a;N;\$!ba;s/;Ports =.*/;Ports = $IRC_PORT, $IRC_ONION_PORT/1" /etc/ngircd/ngircd.conf
7455
+        sed -i "s/;Ports =.*/;Ports = $IRC_PORT, $IRC_ONION_PORT/1" /etc/ngircd/ngircd.conf
7456
     else
7456
     else
7457
-        sed -i ":a;N;\$!ba;s/;Ports =.*/Ports = $IRC_PORT, $IRC_ONION_PORT/1" /etc/ngircd/ngircd.conf
7457
+        sed -i "s/;Ports =.*/Ports = $IRC_PORT, $IRC_ONION_PORT/1" /etc/ngircd/ngircd.conf
7458
     fi
7458
     fi
7459
     sed -i ":a;N;\$!ba;s/;Ports =.*/Ports = $IRC_PORT/2" /etc/ngircd/ngircd.conf
7459
     sed -i ":a;N;\$!ba;s/;Ports =.*/Ports = $IRC_PORT/2" /etc/ngircd/ngircd.conf
7460
     sed -i "s/;Name = #ngircd/Name = #${PROJECT_NAME}/g" /etc/ngircd/ngircd.conf
7460
     sed -i "s/;Name = #ngircd/Name = #${PROJECT_NAME}/g" /etc/ngircd/ngircd.conf

+ 4
- 4
src/freedombone-controlpanel 查看文件

589
         255) return;;
589
         255) return;;
590
     esac
590
     esac
591
     if [[ $irc_onion == 'no' ]]; then
591
     if [[ $irc_onion == 'no' ]]; then
592
-        sed -i ":a;N;\$!ba;s/;Ports =.*/;Ports = $IRC_PORT, $IRC_ONION_PORT/1" /etc/ngircd/ngircd.conf
593
-        sed -i ":a;N;\$!ba;s/;Ports =.*/Ports = $IRC_PORT/2" /etc/ngircd/ngircd.conf
592
+        sed -i "s/;Ports =.*/;Ports = $IRC_PORT, $IRC_ONION_PORT/1" /etc/ngircd/ngircd.conf
593
+        sed -i "s/;Ports =.*/Ports = $IRC_PORT/2" /etc/ngircd/ngircd.conf
594
         systemctl restart ngircd
594
         systemctl restart ngircd
595
         dialog --title $"IRC Server" \
595
         dialog --title $"IRC Server" \
596
                --msgbox $"The IRC server can now be accessed via SSL at your main domain name" 8 50
596
                --msgbox $"The IRC server can now be accessed via SSL at your main domain name" 8 50
597
     else
597
     else
598
-        sed -i ":a;N;\$!ba;s/;Ports =.*/Ports = $IRC_PORT, $IRC_ONION_PORT/1" /etc/ngircd/ngircd.conf
599
-        sed -i ":a;N;\$!ba;s/;Ports =.*/Ports = $IRC_PORT/2" /etc/ngircd/ngircd.conf
598
+        sed -i "s/;Ports =.*/Ports = $IRC_PORT, $IRC_ONION_PORT/1" /etc/ngircd/ngircd.conf
599
+        sed -i "s/;Ports =.*/Ports = $IRC_PORT/2" /etc/ngircd/ngircd.conf
600
         systemctl restart ngircd
600
         systemctl restart ngircd
601
         dialog --title $"IRC Server" \
601
         dialog --title $"IRC Server" \
602
                --msgbox $"The IRC server can now be accessed via its onion address without SSL" 8 50
602
                --msgbox $"The IRC server can now be accessed via its onion address without SSL" 8 50