I am using this script:
#!/bin/bash
case "$1" in
start)
echo "Iniciando servicio"
export http_proxy=socks5://192.168.1.2:9090
export https_proxy <----I don't want it exported
;;
stop)
echo "Deteniendo servicio"
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
;;
esac
but when executing it and by env
I don't get the variable that I created :(
root@:~# /etc/init.d/a start
Iniciando servicio
root@:~# env
SHELL=/bin/bash
NO_AT_BRIDGE=1
PWD=/root
LOGNAME=root
LS_OPTIONS=--color=auto
HOME=/root
TERM=xterm
USER=root
SHLVL=1
SSH_CLIENT=
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
MAIL=/var/mail/root
SSH_TTY=/dev/pts/0
TEXTDOMAIN=Linux-PAM
_=/usr/bin/env
I tried running the script with source but it doesn't work because I want to export a single variable not all