From: Yura Zotov <yznews@hotbox.ru> To: Devel-Sisyphus List <devel@linux.iplabs.ru> Subject: [devel] Стартовый скрипт для установки PPTP соединения Date: Mon, 15 Oct 2001 15:02:40 +0400 Message-ID: <20011015150240.A7898@home-pool4-105.com2com.ru> (raw) [-- Attachment #1: Type: text/plain, Size: 533 bytes --] Здравствуйте. Я тут написал стартовый скрипт для pptp-client. Посмотрите, пожалуйста, кому не лень, выскажите замечания, предложения и т.п. Особенно меня интересует мнение более опытных людей насчет использования временного файла в строках 26-31. $pptp_command - это перлина. При перенаправлении ее вывода куда-либо, кроме файла, процесс останавливается и ждет непонятно чего. По Ctrl-C все прерывается. Кто знает, как сделать лучше, поделитесь, пожалуйста, опытом. Скрипт прицеплен. Заранее спасибо за помощь. -- Юрий А. Зотов [-- Attachment #2: pptpinit --] [-- Type: text/plain, Size: 1696 bytes --] #! /bin/sh # # chkconfig: 2345 11 89 # description: Starts and stops PPTP connection. # processname: pptpinit # Source function library. . /etc/rc.d/init.d/functions # Get config. SourceIfNotEmpty /etc/sysconfig/network SourceIfNotEmpty /etc/sysconfig/pptp # Check that networking is up. [ "$NETWORKING" != "no" ] || exit [ "$PPTP_ONBOOT" != "no" ] || exit LOCKFILE=/var/lock/subsys/pptp RETVAL=0 pptp_command=/usr/local/bin/pptp-command start() { echo -n "Starting PPTP connection: " if [ $PPTP_SET_HOSTNAME = "yes" ]; then TMPFILE=`mktemp /tmp/pptp.XXXXXX` if [ -f $TMPFILE ]; then $pptp_command start $PPTP_TUNNEL > $TMPFILE RETVAL=$? IPADDR=`cat $TMPFILE | awk -F"IP Address: " '/IP Address/ {print $2}'` rm -f $TMPFILE if [ $RETVAL -eq 0 ]; then echo echo "IP Address: $IPADDR" HOSTNAME=`nslookup $IPADDR | grep Name | awk '{print $2}'` if [ "x$HOSTNAME" != "x" ]; then echo -n "Name: $HOSTNAME" hostname $HOSTNAME success echo else echo -n "Hostname lookup failed" failure echo exit 1; fi fi touch "$LOCKFILE" fi else $pptp_command start $PPTP_TUNNEL RETVAL=$? if [ $RETVAL -eq 0 ]; then success echo else failure echo fi fi } stop() { echo -n "Shutting down PPTP connection: " $pptp_command stop &>/dev/null RETVAL=$? if [ $RETVAL -eq 0 ]; then rm -f "$LOCKFILE" success echo fi } restart() { stop start } # See how we were called. case "$1" in start) start ;; stop) stop ;; status) status pptp RETVAL=$? ;; restart) restart ;; *) echo "Usage: ${0##*/} {start|stop|status|restart}" RETVAL=1 esac exit $RETVAL
reply other threads:[~2001-10-15 11:02 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20011015150240.A7898@home-pool4-105.com2com.ru \ --to=yznews@hotbox.ru \ --cc=devel@linux.iplabs.ru \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
ALT Linux Team development discussions This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \ devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru public-inbox-index devel Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.devel AGPL code for this site: git clone https://public-inbox.org/public-inbox.git