From: <abe...@us...> - 2012-01-21 22:14:05
|
Revision: 5400 http://astlinux.svn.sourceforge.net/astlinux/?rev=5400&view=rev Author: abelbeck Date: 2012-01-21 22:13:59 +0000 (Sat, 21 Jan 2012) Log Message: ----------- support ENV variables, http_proxy, https_proxy and ftp_proxy via rc.conf variables using HTTP_PROXY, HTTPS_PROXY and FTP_PROXY respectively Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/profile branches/1.0/project/astlinux/target_skeleton/etc/rc branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf Modified: branches/1.0/project/astlinux/target_skeleton/etc/profile =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/profile 2012-01-20 16:50:06 UTC (rev 5399) +++ branches/1.0/project/astlinux/target_skeleton/etc/profile 2012-01-21 22:13:59 UTC (rev 5400) @@ -1,5 +1,22 @@ export PATH="$PATH:/usr/bin:/bin:/usr/sbin:/sbin" +# Define and export xxx_proxy environmental variables +# This is also done in /etc/rc for startup services +if [ -f /etc/rc.conf ] && grep -q '^[A-Z]*_PROXY=' /etc/rc.conf; then + eval $( + . /etc/rc.conf + if [ -n "$HTTP_PROXY" ]; then + echo "export http_proxy=\"$HTTP_PROXY\"" + fi + if [ -n "$HTTPS_PROXY" ]; then + echo "export https_proxy=\"$HTTPS_PROXY\"" + fi + if [ -n "$FTP_PROXY" ]; then + echo "export ftp_proxy=\"$FTP_PROXY\"" + fi + ) +fi + # This fixes the backspace when telnetting in. if [ "$TERM" != "linux" ]; then stty erase ^? Modified: branches/1.0/project/astlinux/target_skeleton/etc/rc =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/rc 2012-01-20 16:50:06 UTC (rev 5399) +++ branches/1.0/project/astlinux/target_skeleton/etc/rc 2012-01-21 22:13:59 UTC (rev 5400) @@ -341,7 +341,19 @@ touch /var/log/wtmp fi - #Resize filesystems if we need to... + # Define and export xxx_proxy environmental variables + # This is also done in /etc/profile for new logins + if [ -n "$HTTP_PROXY" ]; then + export http_proxy="$HTTP_PROXY" + fi + if [ -n "$HTTPS_PROXY" ]; then + export https_proxy="$HTTPS_PROXY" + fi + if [ -n "$FTP_PROXY" ]; then + export ftp_proxy="$FTP_PROXY" + fi + + # Resize filesystems if we need to... if [ -n "$VAR_SIZE" ]; then mount -o remount,size=$VAR_SIZE /var fi @@ -350,9 +362,6 @@ mount -o remount,size=$TMP_SIZE /tmp fi - # Not needed anymore ? - #ldconfig -C /tmp/etc/ld.so.cache /lib /usr/lib - dmesg > /var/run/dmesg.boot echo "going to runlevel $ASTRLEVEL..." Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2012-01-20 16:50:06 UTC (rev 5399) +++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2012-01-21 22:13:59 UTC (rev 5400) @@ -400,7 +400,15 @@ ## ADNAME is automatically (always) disabled whenever the web interface Network Tab is saved. ADNAME="AstLinux PBX" +## Proxy ENV variables (http_proxy, ftp_proxy, etc.) for curl, wget, etc. +## Format: http://user:pass@proxyhost:proxyport" +## The "user" and "pass" are optional +## Note: A reboot is required after changes to the XXX_PROXY variables. +#HTTP_PROXY="http://proxyhost:8080" +#HTTPS_PROXY="https://proxyhost:8080" +#FTP_PROXY="http://user:pass@proxyhost:8080" + ##################################################################### ### VPN Services ### ##################################################################### This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |