#!/usr/local/bin/pdmenu
#
# Note that the above bang-path isn't required, but it lets you run this
# file directly as a sort of pdmenu script.
# Sample menus for Pdmenu.
# Define the main menu.
menu:main:Main Menu
show:_Search Client..::findclient
show:_Clients...::clients
show:_Tools...::tools
nop
exit:_Exit
menu:findclient:Find Client:Find Client
exec:_Find by ID:: sudo /root/scripts_new/firewall select_id
exec:_Find by Name::sudo /root/scripts_new/firewall select_name
exec:_Find by IP::sudo /root/scripts_new/firewall select_ip
exec:_Find by Pipe::sudo /root/scripts_new/firewall select_pipe
nop
exit:_Main menu..
menu:clients:Clients:Clients
exec:_Add new Client:: sudo /root/scripts_new/firewall new_client
exec:_View Client:: sudo /root/scripts_new/firewall view_client
exec:_Edit Client::sudo /root/scripts_new/firewall edit_client
exec:_Delete Client::sudo /root/scripts_new/firewall delete_client
nop
exit:_Main menu..
menu:tools:Tools:Tools
exec:_Trafshow on em0::sudo /usr/local/bin/trafshow -i em0
exec:_Trafshow on em1::sudo /usr/local/bin/trafshow -i em1
nop
exit:_Main menu..
CONF=`mktemp`
export CONF
...
pdmenu pdmenurc
...
rm -f "${CONF}"
. "${CONF}"
...
sed -i "${CONF}" -e "/^VAR=/d"
echo "VAR=\"${new_var_value}\"" >> "${CONF}"
...
. "${CONF}"
...
echo "${VAR}"
...
cat start.sh
#!/usr/local/bin/bash
export CONF=`mktemp`
pdmenu /root/scripts_new/pdmenurc
rm -f "${CONF}"
exec:_test::sudo /root/scripts_new/1.sh
exec:_test2::sudo /root/scripts_new/2.sh
cat /root/scripts_new/1.sh
#!/usr/local/bin/bash
. "${CONF}"
export K=1
export