Diff of /alx-src/branches/alx-web-070/include/common-functions.php
Parent Directory | Revision Log | Patch
revision 2592 by niro, Tue Jul 5 15:24:46 2011 UTC | revision 2593 by niro, Tue Jul 5 15:26:02 2011 UTC | |
---|---|---|
# | Line 53 function ssh_editvar($var, $value, $file | Line 53 function ssh_editvar($var, $value, $file |
53 | global $ip; | global $ip; |
54 | ||
55 | // sed cmd: ssh -l root 10.11.12.13 'sed -i -e "s|^\(VAR=\).*|\1\"VALUE\"| FILE' | // sed cmd: ssh -l root 10.11.12.13 'sed -i -e "s|^\(VAR=\).*|\1\"VALUE\"| FILE' |
56 | sshdo('if [[ ! -z $(grep "^'.$var.'=" '.$file.') ]]; then sed -i -e "s|^\('.$var.'=\).*|\1\"'.$value.'\"|" '.$file. 'else echo "'.$var.'=\"'.$value.'\"" >> '.file, $ip); | sshdo('if [[ ! -z $(grep "^'.$var.'=" '.$file.') ]]; then sed -i -e "s|^\('.$var.'=\).*|\1\"'.$value.'\"|" '.$file. 'else echo "'.$var.'=\"'.$value.'\"" >> '.$file, $ip); |
57 | } | } |
58 | ||
59 | function online($ip) | function online($ip) |
|