:: Re: [DNG] merge netman-autostart in…
Kezdőlap
Delete this message
Reply to this message
Szerző: aitor_czr
Dátum:  
Címzett: Daniel Reurich, dng
Tárgy: Re: [DNG] merge netman-autostart into netman
Hi Daniel,

On 01/10/2016 02:37 AM, Daniel Reurich <daniel@???> wrote:
> Hi,
>
> I wonder why netman-autostart is a separate package. I think that
> functionality should be included in the netman package and have the
> option to start it at start it handled using a var in
> /etc/default/netman
>
> This could also be configured during install using debconf.
>
> Can we merge netman-autostart into netman??
>
> Thanks,
>     Daniel


There isn't any separate package for that. The only existing packages
are 'netman-gui' and 'netman-backend'. As you suggest, this funcionality
is just configured using debconf in the 'netman-gui.postinst' file:

|#!/bin/sh -e

. /usr/share/debconf/confmodule

db_version 2.0
#db_capb backup
db_capb escape

line="Exec=netman";
launcher="/usr/share/applications/netman.desktop";
autostart="/etc/xdg/autostart/netman.desktop";
comment="Comment=Start Netman without system tray icon";
add_autostart_launcher="false";

STATE=1
while  [  "$STATE"  !=  0 -a"$STATE"  !=  7];do
    case  $STATE  in
    1)  db_input high netman-gui/netman-autostart||  true
    ;;


    2)  db_get netman-gui/netman-autostart
        if  [  "$RET"  =  "true"  ];then
            add_autostart_launcher="true";
        else
        add_autostart_launcher="false";
        fi    
    ;;


    3)  db_input high netman-gui/netman-autoconnect||  true
    ;;


    4)  db_get netman-gui/netman-autoconnect
        if  [  "$RET"  =  "true"  ];then
            line=${line}" --auto-conn";
        fi
    ;;


    5)  db_input high netman-gui/netman-systray-icon||  true
    ;;


    6)  db_get netman-gui/netman-systray-icon
        if  [  "$RET"  =  "true"  ];then
            comment="Comment=Display network connection status in the system tray";
        else
            line=${line}" --no-tray-icon";
            comment="Comment=Do not use a system tray icon for netman";    
        fi
    ;;


    esac

    
    ifdb_go;then
        STATE=$(($STATE  +  1))
    else
        STATE=$(($STATE  -  1))
    fi
done
db_stop


rm -f"${launcher}"
echo \
"[Desktop Entry]
Categories=Application;Network;
${line}
${comment}
GenericName=Netman
Icon=netman.ico
Name=Netman Network Manager
Terminal=false
Type=Application
Categories=Network;" >"${launcher}"


if  [  "$add_autostart_launcher"  =  "true"  ];then
    ln -sf"${launcher}"  "${autostart}"
else
   rm -f"${autostart}"
fi


exit0|