diff options
author | Chris Severance | 2023-01-06 14:43:01 -0500 |
---|---|---|
committer | Chris Severance | 2023-01-06 14:43:01 -0500 |
commit | 9a6bc1d9702701c33cf5ae620ffdf7c2b4676969 (patch) | |
tree | ffdffe092466444ac0af820e29b90ac801025b8b /0000b-advman.systemd.patch | |
parent | e1c1d85e209d0fc8e324196da33b5871146d55d7 (diff) | |
download | aur-9a6bc1d9702701c33cf5ae620ffdf7c2b4676969.tar.gz |
autu: Update to 2.3.0-1
Diffstat (limited to '0000b-advman.systemd.patch')
-rw-r--r-- | 0000b-advman.systemd.patch | 220 |
1 files changed, 220 insertions, 0 deletions
diff --git a/0000b-advman.systemd.patch b/0000b-advman.systemd.patch new file mode 100644 index 000000000000..4fef9e0431a2 --- /dev/null +++ b/0000b-advman.systemd.patch @@ -0,0 +1,220 @@ +diff -pNaru10 a/script/advman b/script/advman +--- a/script/advman 2023-01-04 01:54:06.896867183 -0500 ++++ b/script/advman 2023-01-04 01:55:04.966770369 -0500 +@@ -1,148 +1,35 @@ + #!/bin/bash + + set -u + if [ "${EUID}" -ne 0 ]; then + echo "Must be root" + exit 1 + fi + +-COMMAND=0 +-SCRIPT=$0 +-INSTALLPATH=/usr/share/advtty +-DEAMON=advttyd +-SERVICE=vcomd +-DRIVER=advvcom +-SSLPROXY=advsslvcom +-CONFIGFILE=/etc/advttyd.conf +-DEAMONFILE=$INSTALLPATH/$DEAMON +-#DKMSFILE=/lib/modules/`uname -r`/updates/dkms/$DRIVER.ko +-#KERNEL=`uname -r|cut -c1-3` +-if false # [ $KERNEL = "2.4" ] +-then +-DRIVERFILE=$INSTALLPATH/$DRIVER.o +-else +-DRIVERFILE=$DRIVER +-fi +- +-RETURN= + OBJECTIVE= + +-hasdriver() +-{ +- COUNT=`lsmod | grep $DRIVER -c` +- if [ $COUNT -gt 0 ] +- then +- echo "kernel moduel $DRIVER.ko detected..." +- RETURN=1 +- else +- echo "kernel moduel $DRIVER.ko not installed... try objective \"insert\" first" +- RETURN=0 +- fi +-} +- +-insdriver() +-{ +- if false # [ $KERNEL = "2.4" ] +- then +- echo "inserting kernel moduel $DRIVER.o ..." +- modprobe $DRIVERFILE +- elif [ -e $DRIVERFILE ] +- then +- echo "inserting kernel module $DRIVER.ko ..." +- modprobe $DRIVERFILE +- else +- echo "inserting DKMS moduel $DRIVER ..." +- modprobe $DRIVER +- fi +-} +- +-rmdriver() +-{ +- if false # [ $KERNEL = "2.4" ] +- then +- echo "removing kernel moduel $DRIVER..." +- rmmod $DRIVER +- else +- echo "removing kernel moduel $DRIVER.ko..." +- rmmod $DRIVER.ko +- fi +-} +- +-stopService() +-{ +- echo "stoping all local services..." +- killall -s 9 $SERVICE +-} +- +-startDeamon() +-{ +- # for 2.4.x kernel, we should make node by myself +- if false # [ $KERNEL = "2.4" ] +- then +- i=1 +- while [[ $i -le 256 ]] +- do +- if [ -z $(awk '$2=="vttyAP"{print $1}' /proc/devices) ] +- then +- mknod /dev/vttyAP$i c $(awk '$2=="vttyap/%d"{print $1}' /proc/devices) $i +- else +- mknod /dev/vttyAP$i c $(awk '$2=="vttyAP"{print $1}' /proc/devices) $i +- fi +- ((i = i + 1)) +- done +- fi +- echo "invoking local deamon..." +- install -m 700 -oroot -groot -d /tmp/advmon +- install -m 777 -d /tmp/advsslmsg +- #`$DEAMONFILE` +- $DEAMONFILE +- +-} +- +-stopDeamon() +-{ +-# COUNT=`ps -A|grep $DEAMON -c` +-# while [ $COUNT -gt 0 ] +-# do +-# PID=`ps -A|grep $DEAMON |sed -r s/^[[:space:]]*//g|sed -r s/"[[:space:]]+.+[[:space:]]+[[:digit:]]+:[[:digit:]]+:[[:digit:]]+[[:space:]]+$DEAMON"/""/g | sed '/^[ \t]*$/d'|head -n 1` +-# +-# echo "killing $DEAMON $PID" +-# +-# kill -9 $PID +-# COUNT=`ps -A|grep $DEAMON -c` +-# done +- killall -s 9 $DEAMON +- if false # [ $KERNEL = "2.4" ] +- then +- rm -rf /dev/vttyAP* +- fi +- +- killall -s 9 $SSLPROXY +-} +- +- + usage() + { + cat << EOF + usage: $0 options + + This script lists helps you manage local advtty service. + + OPTIONS: + -h Show this message + -o Execute objective: + start - start advtty local service + stop - stop advtty local service + restart - restart advtty local service +- insert - insert $DRIVER.ko module +- remove - remove $DRIVER.ko module ++ insert - insert module ++ remove - remove module + + Example: + $0 -o start + $0 -o restart + $0 -o stop + + EOF + } + + while getopts 'ho:' OPTION +@@ -157,56 +44,38 @@ do + ;; + ?) + usage + exit + ;; + esac + done + + case $OBJECTIVE in + start) +- hasdriver +- if [ $RETURN -eq 1 ] +- then +- echo "starting service...." +- startDeamon +- else +- echo "installing driver & start service..." +- insdriver +- startDeamon +- fi ++ systemctl start 'advtty-vcom.service' + exit 0 + ;; + restart) +- hasdriver +- if [ $RETURN -eq 1 ] +- then +- echo "starting service...." +- startDeamon +- else +- echo "can not start service..." +- insdriver +- startDeamon +- fi ++ systemctl reload 'advtty-vcom.service' + exit 0 + + ;; + stop) +- echo stop +- stopService +- stopDeamon ++ systemctl stop 'advtty-vcom.service' + exit 0 + ;; + insert) +- insdriver ++ modprobe 'advvcom' + exit 0 + ;; + remove) +- stopService +- stopDeamon +- rmdriver ++ systemctl stop 'advtty-vcom.service' + exit 0 + ;; ++ *) ++ usage ++ exit 1 ++ ;; + esac + usage + + |